]> git.vpit.fr Git - perl/modules/Scope-Upper.git/commitdiff
Prevent a future possible declaration-after-code error
authorVincent Pit <perl@profvince.com>
Mon, 6 Jun 2016 08:53:10 +0000 (10:53 +0200)
committerVincent Pit <perl@profvince.com>
Mon, 6 Jun 2016 08:53:37 +0000 (10:53 +0200)
Right now SU_HAS_NEW_CXT implies defined(gv_fetchsv), but better
make this more obvious.

Upper.xs

index 386bf5abe245f267c9515c0ca39ca2c2f7f10f2f..6ff176d68d913973734a80e8bde1d18b85eec2eb 100644 (file)
--- a/Upper.xs
+++ b/Upper.xs
@@ -911,10 +911,13 @@ static void su_localize(pTHX_ void *ud_) {
 #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 = old_cop;
 #endif