summaryrefslogtreecommitdiff
path: root/ext/attributes/attributes.xs
diff options
context:
space:
mode:
Diffstat (limited to 'ext/attributes/attributes.xs')
-rw-r--r--ext/attributes/attributes.xs4
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/attributes/attributes.xs b/ext/attributes/attributes.xs
index 20dc33d187..24f5f6185e 100644
--- a/ext/attributes/attributes.xs
+++ b/ext/attributes/attributes.xs
@@ -48,6 +48,10 @@ modify_SV_attributes(pTHX_ SV *sv, SV **retlist, SV **attrlist, int numattrs)
switch (name[3]) {
case 'l':
if (memEQ(name, "lvalue", 6)) {
+ if (!CvISXSUB(MUTABLE_CV(sv))
+ && CvROOT(MUTABLE_CV(sv))
+ && !CvLVALUE(MUTABLE_CV(sv)) != negated)
+ break;
if (negated)
CvFLAGS(MUTABLE_CV(sv)) &= ~CVf_LVALUE;
else