-I32
-Perl_debop(pTHX_ OP *o)
-{
-#ifdef DEBUGGING
- AV *padlist, *comppad;
- CV *cv;
- SV *sv;
- STRLEN n_a;
- Perl_deb(aTHX_ "%s", OP_NAME(o));
- switch (o->op_type) {
- case OP_CONST:
- PerlIO_printf(Perl_debug_log, "(%s)", SvPEEK(cSVOPo_sv));
- break;
- case OP_GVSV:
- case OP_GV:
- if (cGVOPo_gv) {
- sv = NEWSV(0,0);
- gv_fullname3(sv, cGVOPo_gv, Nullch);
- PerlIO_printf(Perl_debug_log, "(%s)", SvPV(sv, n_a));
- SvREFCNT_dec(sv);
- }
- else
- PerlIO_printf(Perl_debug_log, "(NULL)");
- break;
- case OP_PADSV:
- case OP_PADAV:
- case OP_PADHV:
- /* print the lexical's name */
- cv = deb_curcv(cxstack_ix);
- if (cv) {
- padlist = CvPADLIST(cv);
- comppad = (AV*)(*av_fetch(padlist, 0, FALSE));
- sv = *av_fetch(comppad, o->op_targ, FALSE);
- } else
- sv = Nullsv;
- if (sv)
- PerlIO_printf(Perl_debug_log, "(%s)", SvPV_nolen(sv));
- else
- PerlIO_printf(Perl_debug_log, "[%"UVuf"]", (UV)o->op_targ);
+ AV * old_curstack = PL_curstack;
+
+ /* run the real loop while catching exceptions */
+ dJMPENV;
+ int ret;
+ JMPENV_PUSH(ret);
+ switch (ret) {
+ case 0: /* normal return from JMPENV_PUSH */
+ cur_env.je_mustcatch = cur_env.je_prev->je_mustcatch;
+ PL_runops(aTHX); /* call the real loop */
+
+ revert:
+ /* revert stack back its non-ref-counted state */
+ assert(AvREAL(PL_curstack));
+
+ if (cut) {
+ /* undo the stack reification that took place at the beginning of
+ * this function */
+ if (UNLIKELY(!was_real))
+ AvREAL_off(PL_curstack);
+
+ SSize_t n = PL_stack_sp - (PL_stack_base + cut) + 1;
+ if (n > 0) {
+ /* we need to decrement the refcount of every SV from cut
+ * upwards; but this may prematurely free them, so
+ * mortalise them instead */
+ EXTEND_MORTAL(n);
+ for (SSize_t i = 0; i < n; i ++) {
+ SV* sv = PL_stack_base[cut + i];
+ if (sv)
+ PL_tmps_stack[++PL_tmps_ix] = sv;
+ }
+ }
+
+ I32 sp1 = PL_stack_sp - PL_stack_base + 1;
+ PL_curstackinfo->si_stack_nonrc_base =
+ old_base > sp1 ? sp1 : old_base;
+ }