In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/02c161ef974f8f1efbb5632f741c1164adb6ca75?hp=fbceb79751d97a15e33501de097e506ae24c0e58>
- Log ----------------------------------------------------------------- commit 02c161ef974f8f1efbb5632f741c1164adb6ca75 Author: Tony Cook <[email protected]> Date: Mon Dec 5 11:48:14 2016 +1100 (perl #130262) split scalar context stack overflow fix pp_split didn't ensure there was space for its return value in scalar context. ----------------------------------------------------------------------- Summary of changes: pp.c | 2 +- t/op/split.t | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pp.c b/pp.c index adda6c9945..657abf7450 100644 --- a/pp.c +++ b/pp.c @@ -6142,7 +6142,7 @@ PP(pp_split) } GETTARGET; - PUSHi(iters); + XPUSHi(iters); RETURN; } diff --git a/t/op/split.t b/t/op/split.t index 81c908e875..d60bcafc19 100644 --- a/t/op/split.t +++ b/t/op/split.t @@ -7,7 +7,7 @@ BEGIN { set_up_inc('../lib'); } -plan tests => 162; +plan tests => 163; $FS = ':'; @@ -629,3 +629,7 @@ is "@a", '1 2 3', 'assignment to split-to-array (stacked)'; my @a = split ' ', $s; is (+@a, 0, "empty utf8 string"); } + +fresh_perl_is(<<'CODE', '', {}, "scalar split stack overflow"); +map{int"";split//.0>60for"0000000000000000"}split// for"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" +CODE -- Perl5 Master Repository
