This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #40557] regexec.c saves context stack position improperly
[perl5.git] / scope.h
diff --git a/scope.h b/scope.h
index 9943a05..377a8b4 100644 (file)
--- a/scope.h
+++ b/scope.h
@@ -52,6 +52,7 @@
 #define SAVEt_COP_ARYBASE      41
 #define SAVEt_RE_STATE         42
 #define SAVEt_COMPILE_WARNINGS 43
+#define SAVEt_STACK_CXPOS      44
 
 #ifndef SCOPE_SAVES_SIGNAL_MASK
 #define SCOPE_SAVES_SIGNAL_MASK 0
@@ -205,6 +206,14 @@ Closing bracket on a callback.  See C<ENTER> and L<perlcall>.
        SSPUSHINT(SAVEt_COMPILE_WARNINGS);              \
     } STMT_END
 
+#define SAVESTACK_CXPOS() \
+    STMT_START {                                  \
+        SSCHECK(3);                               \
+        SSPUSHINT(cxstack[cxstack_ix].blk_oldsp); \
+        SSPUSHINT(cxstack_ix);                    \
+        SSPUSHINT(SAVEt_STACK_CXPOS);             \
+    } STMT_END
+
 #ifdef USE_ITHREADS
 #  define SAVECOPSTASH(c)      SAVEPPTR(CopSTASHPV(c))
 #  define SAVECOPSTASH_FREE(c) SAVESHAREDPV(CopSTASHPV(c))