This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perldelta updates
[perl5.git] / inline.h
index 46f8d9d..4cc6a74 100644 (file)
--- a/inline.h
+++ b/inline.h
@@ -125,6 +125,29 @@ PadnameIN_SCOPE(const PADNAME * const pn, const U32 seq)
 }
 #endif
 
+/* ------------------------------- pp.h ------------------------------- */
+
+PERL_STATIC_INLINE I32
+S_TOPMARK(pTHX)
+{
+    DEBUG_s(DEBUG_v(PerlIO_printf(Perl_debug_log,
+                                "MARK top  %p %"IVdf"\n",
+                                 PL_markstack_ptr,
+                                 (IV)*PL_markstack_ptr)));
+    return *PL_markstack_ptr;
+}
+
+PERL_STATIC_INLINE I32
+S_POPMARK(pTHX)
+{
+    DEBUG_s(DEBUG_v(PerlIO_printf(Perl_debug_log,
+                                "MARK pop  %p %"IVdf"\n",
+                                 (PL_markstack_ptr-1),
+                                 (IV)*(PL_markstack_ptr-1))));
+    assert((PL_markstack_ptr > PL_markstack) || !"MARK underflow");
+    return *PL_markstack_ptr--;
+}
+
 /* ----------------------------- regexp.h ----------------------------- */
 
 PERL_STATIC_INLINE struct regexp *
@@ -624,8 +647,10 @@ S_cx_popeval(pTHX_ PERL_CONTEXT *cx)
     }
 
     sv = cx->blk_eval.old_namesv;
-    if (sv && !SvTEMP(sv))/* TEMP implies cx_popeval() re-entrantly called */
-        sv_2mortal(sv);
+    if (sv) {
+        cx->blk_eval.old_namesv = NULL;
+        SvREFCNT_dec_NN(sv);
+    }
 }