diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1998-04-03 06:59:37 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1998-04-03 06:59:37 +0000 |
commit | e336de0d01f30cc4061b6d6a00d11df30fc67cd3 (patch) | |
tree | 47af4eae88807f461d216a10701a0502a2373226 /pp_ctl.c | |
parent | dfb1c8b93631b1cf8c1d0d2295ffff2bf0f098a7 (diff) | |
download | perl-e336de0d01f30cc4061b6d6a00d11df30fc67cd3.tar.gz |
[win32] implement stack-of-stacks so that magic invocations don't
invalidate local stack pointer
p4raw-id: //depot/win32/perl@864
Diffstat (limited to 'pp_ctl.c')
-rw-r--r-- | pp_ctl.c | 21 |
1 files changed, 8 insertions, 13 deletions
@@ -705,7 +705,6 @@ PP(pp_sort) max = --up - myorigmark; if (sortcop) { if (max > 1) { - AV *oldstack; PERL_CONTEXT *cx; SV** newsp; bool oldcatch = CATCH_GET; @@ -713,14 +712,8 @@ PP(pp_sort) SAVETMPS; SAVEOP(); - oldstack = curstack; - if (!sortstack) { - sortstack = newAV(); - AvREAL_off(sortstack); - av_extend(sortstack, 32); - } CATCH_SET(TRUE); - SWITCHSTACK(curstack, sortstack); + PUSHSTACK(SI_SORT); if (sortstash != stash) { firstgv = gv_fetchpv("a", TRUE, SVt_PV); secondgv = gv_fetchpv("b", TRUE, SVt_PV); @@ -744,7 +737,7 @@ PP(pp_sort) qsortsv(myorigmark+1, max, sortcv); POPBLOCK(cx,curpm); - SWITCHSTACK(sortstack, oldstack); + POPSTACK(); CATCH_SET(oldcatch); } LEAVE; @@ -1036,7 +1029,7 @@ dounwind(I32 cxix) OP * die_where(char *message) { - dTHR; + dSP; if (in_eval) { I32 cxix; register PERL_CONTEXT *cx; @@ -1066,7 +1059,9 @@ die_where(char *message) else sv_setpv(ERRSV, message); - cxix = dopoptoeval(cxstack_ix); + while ((cxix = dopoptoeval(cxstack_ix)) < 0 && curstackinfo->si_prev) + POPSTACK(); + if (cxix >= 0) { I32 optype; @@ -1436,7 +1431,7 @@ PP(pp_return) PMOP *newpm; I32 optype = 0; - if (curstack == sortstack) { + if (curstackinfo->si_type == SI_SORT) { if (cxstack_ix == sortcxix || dopoptosub(cxstack_ix) <= sortcxix) { if (cxstack_ix > sortcxix) dounwind(sortcxix); @@ -1991,7 +1986,7 @@ PP(pp_goto) do_undump = FALSE; } - if (curstack == signalstack) { + if (top_env->je_prev) { restartop = retop; JMPENV_JUMP(3); } |