This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Use sv_catpvn instead of sv_catsv in doop.c:do_join
[perl5.git] / scope.h
diff --git a/scope.h b/scope.h
index 6afee09..cad02cd 100644 (file)
--- a/scope.h
+++ b/scope.h
 #define SAVEt_CLEARPADRANGE    1
 #define SAVEt_CLEARSV          2
 #define SAVEt_REGCONTEXT       3
-/*** SPARE                     4 ***/
 
-#define SAVEt_ARG0_MAX         4
+#define SAVEt_ARG0_MAX         3
 
 /* one arg */
 
+#define SAVEt_GP_ALIASED_SV    4
 #define SAVEt_BOOL             5
 #define SAVEt_COMPILE_WARNINGS 6
 #define SAVEt_COMPPAD          7
@@ -64,7 +64,7 @@
 #define SAVEt_SAVESWITCHSTACK  39
 #define SAVEt_SHARED_PVREF     40
 #define SAVEt_SPTR             41
-/*     UNUSED                  42 */
+#define SAVEt_STRLEN           42
 #define SAVEt_SV               43
 #define SAVEt_SVREF            44
 #define SAVEt_VPTR             45
@@ -98,8 +98,8 @@
  * macros */
 #define SS_MAXPUSH 4
 
-#define SSCHECK(need) if (PL_savestack_ix + (I32)(need) + SS_MAXPUSH > PL_savestack_max) savestack_grow()
-#define SSGROW(need) if (PL_savestack_ix + (I32)(need) + SS_MAXPUSH > PL_savestack_max) savestack_grow_cnt(need + SS_MAXPUSH)
+#define SSCHECK(need) if (UNLIKELY(PL_savestack_ix + (I32)(need) + SS_MAXPUSH > PL_savestack_max)) savestack_grow()
+#define SSGROW(need) if (UNLIKELY(PL_savestack_ix + (I32)(need) + SS_MAXPUSH > PL_savestack_max)) savestack_grow_cnt(need + SS_MAXPUSH)
 #define SSPUSHINT(i) (PL_savestack[PL_savestack_ix++].any_i32 = (I32)(i))
 #define SSPUSHLONG(i) (PL_savestack[PL_savestack_ix++].any_long = (long)(i))
 #define SSPUSHBOOL(p) (PL_savestack[PL_savestack_ix++].any_bool = (p))
 
 #define dSS_ADD \
     I32 ix = PL_savestack_ix;     \
-    ANY *ssp = &PL_savestack[ix];
+    ANY *ssp = &PL_savestack[ix]
 
 #define SS_ADD_END(need) \
     assert((need) <= SS_MAXPUSH);                               \
     ix += (need);                                               \
     PL_savestack_ix = ix;                                       \
     assert(ix <= PL_savestack_max);                             \
-    if ((ix + SS_MAXPUSH) > PL_savestack_max) savestack_grow(); \
+    if (UNLIKELY((ix + SS_MAXPUSH) > PL_savestack_max)) savestack_grow(); \
     assert(PL_savestack_ix + SS_MAXPUSH <= PL_savestack_max);
 
 #define SS_ADD_INT(i)   ((ssp++)->any_i32 = (I32)(i))
@@ -186,7 +186,8 @@ scope has the given name. Name must be a literal string.
 =cut
 */
 
-#define SAVETMPS save_int((int*)&PL_tmps_floor), PL_tmps_floor = PL_tmps_ix
+#define SAVETMPS Perl_save_strlen(aTHX_ (STRLEN *)&PL_tmps_floor), \
+                PL_tmps_floor = PL_tmps_ix
 #define FREETMPS if (PL_tmps_ix > PL_tmps_floor) free_tmps()
 
 #ifdef DEBUGGING
@@ -253,7 +254,7 @@ scope has the given name. Name must be a literal string.
 #define SAVEHDELETE(h,s) \
          save_hdelete(MUTABLE_HV(h), (s))
 #define SAVEADELETE(a,k) \
-         save_adelete(MUTABLE_AV(a), (I32)(k))
+         save_adelete(MUTABLE_AV(a), (SSize_t)(k))
 #define SAVEDESTRUCTOR(f,p) \
          save_destructor((DESTRUCTORFUNC_NOCONTEXT_t)(f), (void*)(p))