diff options
author | Father Chrysostomos <sprout@cpan.org> | 2015-02-01 14:04:33 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2015-02-01 14:25:16 -0800 |
commit | 83a85f49e265a458a481a9dc402dd3bdd30ae457 (patch) | |
tree | 239e75fb9ca12d8fe462ae614bdd9ffaee6129c2 /t/base | |
parent | 47fb2434438e67771e77bd3fb9733cd75cb7cf7d (diff) | |
download | perl-83a85f49e265a458a481a9dc402dd3bdd30ae457.tar.gz |
[perl #123711] Fix crash with 0-5x-l{0}
perl-5.8.0-117-g6f33ba7, which added the XTERMORDORDOR hack, did not
change the leftbracket code to treat XTERMORDORDOR the same way as
XTERM, so -l {0} and getc {0} (among other ops) were treating {...} as
a block, rather than an anonymous hash. This was not, however, being
turned into a real block with enter/leave ops to protect the stack,
so the nextstate op was corrupting the stack and possibly freeing mor-
tals in use.
This commit makes the leftbracket code check for XTERMORDORDOR and
treat it like XTERM, so that -l {0} once more creates an anonymous
hash. There is really no way to get to that hash, though, so all I
can test for is the crash.
Diffstat (limited to 't/base')
-rw-r--r-- | t/base/lex.t | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/t/base/lex.t b/t/base/lex.t index c917d4f4fd..f93816855c 100644 --- a/t/base/lex.t +++ b/t/base/lex.t @@ -482,3 +482,6 @@ print "not " unless &{sub :lvalue { "a" }} eq "a"; print "ok $test - &{sub :lvalue...}\n"; $test++; print "not " unless ref +(map{sub :lvalue { "a" }} 1)[0] eq "CODE"; print "ok $test - map{sub :lvalue...}\n"; $test++; + +# Used to crash [perl #123711] +0-5x-l{0}; |