Fix bug #24108: Goto +foo broken
[p5sagit/p5-mst-13.2.git] / op.c
diff --git a/op.c b/op.c
index 1aecdaf..f08e6a3 100644 (file)
--- a/op.c
+++ b/op.c
@@ -3781,7 +3781,9 @@ Perl_newLOOPEX(pTHX_ I32 type, OP *label)
        op_free(label);
     }
     else {
-       if (label->op_type == OP_ENTERSUB)
+       /* Check whether it's going to be a goto &function */
+       if (label->op_type == OP_ENTERSUB
+               && !(label->op_flags & OPf_STACKED))
            label = newUNOP(OP_REFGEN, 0, mod(label, OP_REFGEN));
        o = newUNOP(type, OPf_STACKED, label);
     }