This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
fix bogus OPf_REF context for the BLOCK in C<grep BLOCK @foo>
[perl5.git] / op.c
diff --git a/op.c b/op.c
index f22a5d2..d5af3c9 100644 (file)
--- a/op.c
+++ b/op.c
@@ -4306,7 +4306,7 @@ newAVREF(OP *o)
 OP *
 newGVREF(I32 type, OP *o)
 {
 OP *
 newGVREF(I32 type, OP *o)
 {
-    if (type == OP_MAPSTART)
+    if (type == OP_MAPSTART || type == OP_GREPSTART)
        return newUNOP(OP_NULL, 0, o);
     return ref(newUNOP(OP_RV2GV, OPf_REF, o), type);
 }
        return newUNOP(OP_NULL, 0, o);
     return ref(newUNOP(OP_RV2GV, OPf_REF, o), type);
 }