summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorDave Mitchell <davem@fdisolutions.com>2005-05-04 20:30:00 +0000
committerDave Mitchell <davem@fdisolutions.com>2005-05-04 20:30:00 +0000
commit6ab4a6ffb5877cdeb02bbdd245f9610e46bb2746 (patch)
tree20ebf647ac44b2ee67ca22d9aa6d5016ab95d390 /t
parent4269b21d31641a087d235fa15be3b307d755c185 (diff)
downloadperl-6ab4a6ffb5877cdeb02bbdd245f9610e46bb2746.tar.gz
add test for [perl #34682] leaving eval via last in inner runops
p4raw-id: //depot/perl@24387
Diffstat (limited to 't')
-rwxr-xr-xt/op/eval.t13
1 files changed, 12 insertions, 1 deletions
diff --git a/t/op/eval.t b/t/op/eval.t
index 6aef5b88e5..d64504c1ee 100755
--- a/t/op/eval.t
+++ b/t/op/eval.t
@@ -5,7 +5,7 @@ BEGIN {
@INC = '../lib';
}
-print "1..91\n";
+print "1..92\n";
eval 'print "ok 1\n";';
@@ -438,3 +438,14 @@ print "ok ",$test++," - #20798 (used to dump core)\n";
eval $code;
print $c eq 'V' ? "ok " : "# '$c' ne 'V'\nnot ok ", $test++, "\n";
}
+
+# [perl #34682] escaping an eval with last could coredump or dup output
+
+$got = runperl (
+ prog =>
+ 'sub A::TIEARRAY { L: { eval { last L } } } tie @a, A; warn qq(ok\n)',
+stderr => 1);
+
+print "not " unless $got eq "ok\n";
+print "ok $test - eval and last\n"; $test++;
+