This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
don't lose mark when pp_reverse extends stack
authorZefram <zefram@fysh.org>
Fri, 8 Dec 2017 19:23:29 +0000 (19:23 +0000)
committerZefram <zefram@fysh.org>
Thu, 14 Dec 2017 19:38:52 +0000 (19:38 +0000)
commit47836a13cc4c999c9b3589c6797d6769b52c37fd
tree4042f0589bf6544903e94cdcfb2dc64b8857f0b0
parentb2ad2123be0005e33a47e297d0d9bdc640f635ea
don't lose mark when pp_reverse extends stack

Nullary reverse needs to extend the stack to push its result scalar.
It was actually extending the stack, but doing so invalidated MARK,
which it relied upon to place the stack pointer afterwards.  Upon stack
reallocation it was therefore leaving the stack pointer pointing to the
freed stack memory.  Reformulate stack manipulation to not rely on MARK
after extending.  Fixes [perl #132544].
pp.c
t/op/reverse.t