diff options
author | Father Chrysostomos <sprout@cpan.org> | 2014-12-28 17:07:47 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2014-12-28 17:08:56 -0800 |
commit | f605e5277bb65662910d4a5b8f8e6ac010f9295a (patch) | |
tree | 5b2b6951b300a2b917fdc9cae5e479708ff67c4f | |
parent | add3e777b167c912c9b05920df015a3763ed4ccd (diff) | |
download | perl-f605e5277bb65662910d4a5b8f8e6ac010f9295a.tar.gz |
Fix bad write in pp_trans
y/// has not been extending the stack for lexical $_, even since lex-
ical $_ was added. $lexical =~ y/// has not been extending the stack
since v5.21.5-339-g05a502d.
-rw-r--r-- | pp.c | 8 | ||||
-rw-r--r-- | t/op/tr.t | 4 |
2 files changed, 9 insertions, 3 deletions
@@ -746,11 +746,13 @@ PP(pp_trans) if (PL_op->op_flags & OPf_STACKED) sv = POPs; - else if (ARGTARG) - sv = GETTARGET; else { - sv = DEFSV; EXTEND(SP,1); + if (ARGTARG) + sv = GETTARGET; + else { + sv = DEFSV; + } } if(PL_op->op_type == OP_TRANSR) { STRLEN len; @@ -10,6 +10,10 @@ BEGIN { plan tests => 134; +# Test this first before we extend the stack with other operations. +# This caused an asan failure due to a bad write past the end of the stack. +eval { my $x; die 1..127, $x =~ y/// }; + my $Is_EBCDIC = (ord('i') == 0x89 & ord('J') == 0xd1); $_ = "abcdefghijklmnopqrstuvwxyz"; |