the fix having been suggested by xmath via Juerd.
p4raw-id: //depot/perl@21425
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);
}
@INC = qw(. ../lib);
}
-print "1..30\n";
+print "1..32\n";
require "test.pl";
is($r, "OK\nDONE\n", "goto within use-d file");
unlink "goto01.pm";
+# test for [perl #24108]
+sub i_return_a_label {
+ print "ok 31 - i_return_a_label called\n";
+ return "returned_label";
+}
+eval { goto +i_return_a_label; };
+print "not ";
+returned_label : print "ok 32 - done to returned_label\n";
exit;