When creating a temporary new argument stack, su_uplevel() copies most of
the old stack to a new one. This isn't really needed, as the new stack
will be abandoned before it ever pops back to that level. But it *is*
needed when debugging code prints out the stack, as in for example,
'perl -Dstv'.
However, the code didn't actually copy the old stack: it copied garbage
instead, since it was using PL_curstack rather than AvARRAY(PL_curstack)
as the address of of the old stack. Which was causing 'perl -Dstv' to
SEGV.
This commit fixes that.
* target context, plus the forthcoming arguments. */
new_mark = cx->blk_oldsp;
av_extend(si->si_stack, new_mark + 1 + args + 1);
- Copy(PL_curstack, AvARRAY(si->si_stack), new_mark + 1, SV *);
+ Copy(AvARRAY(PL_curstack), AvARRAY(si->si_stack), new_mark + 1, SV *);
AvFILLp(si->si_stack) = new_mark;
SU_POISON(AvARRAY(si->si_stack) + new_mark + 1, args + 1, SV *);