This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
clone() wasn't cloning the whole stack
authorDavid Mitchell <davem@iabyn.com>
Fri, 16 Nov 2012 18:04:49 +0000 (18:04 +0000)
committerDavid Mitchell <davem@iabyn.com>
Fri, 16 Nov 2012 19:06:38 +0000 (19:06 +0000)
commitba593adc2b8b59175ac3c28b7b41aef7a74908e2
treeedee18e3b891283f3bae93281c4466890cb49e6f
parentcfd4abf2bf035401d8184babc5d1aca80208cd5b
clone() wasn't cloning the whole stack

When cloning stacks (e.g. for fake fork), the stack is cloned
by copying the stack AV pointed to by PL_curstackinfo; but the
AvFILL on that AV may not be up to date, resulting in the top N
items of the stack not being cloned. Fix by saving PL_stack_sp
back into AvFILL(PL_curstack) before cloning
ext/XS-APItest/t/clone-with-stack.t
sv.c