This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
toke.c Refactor S_get_and_check_backslash_N_name()
[perl5.git] / scope.h
diff --git a/scope.h b/scope.h
index f8df5b4..de18fe0 100644 (file)
--- a/scope.h
+++ b/scope.h
@@ -58,6 +58,7 @@
 #define SAVEt_INT_SMALL                48
 #define SAVEt_GVSV             49
 #define SAVEt_FREECOPHH                50
+#define SAVEt_CLEARPADRANGE    51
 
 #define SAVEf_SETMAGIC         1
 #define SAVEf_KEEPOLDELEM      2
@@ -162,7 +163,9 @@ scope has the given name. Name must be a literal string.
 #define ENTER_with_name(name) ENTER
 #define LEAVE_with_name(name) LEAVE
 #endif
-#define LEAVE_SCOPE(old) if (PL_savestack_ix > old) leave_scope(old)
+#define LEAVE_SCOPE(old) STMT_START { \
+       if (PL_savestack_ix > old) leave_scope(old); \
+    } STMT_END
 
 #define SAVEI8(i)      save_I8((I8*)&(i))
 #define SAVEI16(i)     save_I16((I16*)&(i))
@@ -273,6 +276,7 @@ scope has the given name. Name must be a literal string.
 # define save_freeop(op)                    \
     ({                                       \
       OP * const _o = (OP *)(op);             \
+      assert(!_o->op_savefree);               \
       _o->op_savefree = 1;                     \
       save_pushptr((void *)(_o), SAVEt_FREEOP); \
     })
@@ -280,6 +284,7 @@ scope has the given name. Name must be a literal string.
 # define save_freeop(op)                       \
     (                                           \
       PL_Xpv = (XPV *)(op),                      \
+      assert_(!((OP *)PL_Xpv)->op_savefree)      \
       ((OP *)PL_Xpv)->op_savefree = 1,            \
       save_pushptr((void *)(PL_Xpv), SAVEt_FREEOP) \
     )