if (cxix < cxstack_ix)
dounwind(cxix);
- /* RETURNOP calls PUTBACK which restores the old old sp */
+ /* Restore the sp at the time we entered the given block */
+ TOPBLOCK(cx);
+
return cx->blk_givwhen.leave_op;
}
use strict;
use warnings;
-plan tests => 196;
+plan tests => 197;
# The behaviour of the feature pragma should be tested by lib/feature.t
# using the tests in t/lib/feature/*. This file tests the behaviour of
};
}
+# break() must reset the stack
+{
+ my @res = (1, do {
+ given ("x") {
+ 2, 3, do {
+ when (/[a-z]/) {
+ 4, 5, 6, break
+ }
+ }
+ }
+ });
+ is "@res", "1", "break resets the stack";
+}
+
# Okay, that'll do for now. The intricacies of the smartmatch
# semantics are tested in t/op/smartmatch.t
__END__