]> git.vpit.fr Git - perl/modules/Scope-Upper.git/blobdiff - Upper.xs
Only define su_cxt_enter_count when XSH_DEBUG is set
[perl/modules/Scope-Upper.git] / Upper.xs
index e810d69b77603810c207334ee09fcb24e3cf1e6c..114161a4879cd4ddfe7f13162360f09ecd0ce89e 100644 (file)
--- a/Upper.xs
+++ b/Upper.xs
@@ -900,24 +900,26 @@ static void su_localize(pTHX_ void *ud_) {
  if (SvTYPE(sv) >= SVt_PVGV) {
   gv = (GV *) sv;
  } else {
-
 /* new perl context implementation frees savestack *before* restoring
  * PL_curcop. Temporarily restore it prematurely to make gv_fetch*
  * looks up unqualified var names in the caller's package */
 #if SU_HAS_NEW_CXT
   COP *old_cop = PL_curcop;
-  PL_curcop = CX_CUR()->blk_oldcop;
+  PL_curcop    = CX_CUR()->blk_oldcop;
 #endif
 
 #ifdef gv_fetchsv
   gv = gv_fetchsv(sv, GV_ADDMULTI, t);
 #else
-  STRLEN len;
-  const char *name = SvPV_const(sv, len);
-  gv = gv_fetchpvn_flags(name, len, GV_ADDMULTI, t);
+  {
+   STRLEN len;
+   const char *name = SvPV_const(sv, len);
+   gv = gv_fetchpvn_flags(name, len, GV_ADDMULTI, t);
+  }
 #endif
+
 #if SU_HAS_NEW_CXT
-  CX_CUR()->blk_oldcop = PL_curcop;
+  CX_CUR()->blk_oldcop = old_cop;
 #endif
  }
 
@@ -1048,6 +1050,8 @@ static const char *su_block_type[] = {
 
 #define SU_CXNAME(C) SU_CX_TYPENAME(CxTYPE(C))
 
+#if XSH_DEBUG
+
 /* for debugging. These indicate how many ENTERs each context type
  * does before the PUSHBLOCK */
 
@@ -1067,6 +1071,8 @@ static const int su_cxt_enter_count[] = {
 # endif
 };
 
+#endif /* XSH_DEBUG */
+
 /* push at least 'size' slots worth of padding onto the savestack */
 
 static void su_ss_push_padding(pTHX_ void *ud, I32 size) {
@@ -1087,7 +1093,6 @@ static void su_pop(pTHX_ void *ud);
 
 static void su_ss_push_destructor(pTHX_ void *ud, I32 depth, bool first) {
  su_ud_origin_elem *origin = SU_UD_ORIGIN(ud);
- I32 pad;
 
  assert(first || origin[depth+1].orig_ix == PL_savestack_ix);
  su_ss_push_padding(aTHX_ ud,
@@ -1164,7 +1169,7 @@ static void su_pop(pTHX_ void *ud) {
 
 static void su_init(pTHX_ void *ud, I32 cxix, I32 size) {
 #define su_init(U, C, S) su_init(aTHX_ (U), (C), (S))
- I32 i, depth, base;
+ I32 i, depth;
  su_ud_origin_elem *origin;
  I32 cur_cx_ix;
  I32 cur_scope_ix;