Create a new local $_ without triggering tie by using local *_ = \my $a
[p5sagit/p5-mst-13.2.git] / perl.c
diff --git a/perl.c b/perl.c
index 3860d2d..dfc2a3f 100644 (file)
--- a/perl.c
+++ b/perl.c
@@ -809,9 +809,6 @@ perl_destruct(pTHXx)
     SvREFCNT(&PL_sv_undef) = 0;
     SvREADONLY_off(&PL_sv_undef);
 
-    SvREFCNT(&PL_sv_placeholder) = 0;
-    SvREADONLY_off(&PL_sv_placeholder);
-
     Safefree(PL_origfilename);
     PL_origfilename = Nullch;
     Safefree(PL_reg_start_tmp);
@@ -942,11 +939,11 @@ setuid perl scripts securely.\n");
 #if defined(USE_HASH_SEED) || defined(USE_HASH_SEED_EXPLICIT)
     /* [perl #22371] Algorimic Complexity Attack on Perl 5.6.1, 5.8.0
      * This MUST be done before any hash stores or fetches take place.
-     * If you set PL_hash_seed (and assumedly also PL_hash_seed_set) yourself,
-     * it is your responsibility to provide a good random seed!
+     * If you set PL_rehash_seed (and assumedly also PL_rehash_seed_set)
+     * yourself, it is your responsibility to provide a good random seed!
      * You can also define PERL_HASH_SEED in compile time, see hv.h. */
-    if (!PL_new_hash_seed_set)
-        PL_new_hash_seed = get_hash_seed();
+    if (!PL_rehash_seed_set)
+        PL_rehash_seed = get_hash_seed();
     {
         char *s = PerlEnv_getenv("PERL_HASH_SEED_DEBUG");
 
@@ -955,7 +952,7 @@ setuid perl scripts securely.\n");
 
              if (i == 1)
                   PerlIO_printf(Perl_debug_log, "HASH_SEED = %"UVuf"\n",
-                                PL_new_hash_seed);
+                                PL_rehash_seed);
         }
     }
 #endif /* #if defined(USE_HASH_SEED) || defined(USE_HASH_SEED_EXPLICIT) */
@@ -966,7 +963,7 @@ setuid perl scripts securely.\n");
     {
        /* Set PL_origalen be the sum of the contiguous argv[]
         * elements plus the size of the env in case that it is
-        * contiguous with the argv[].  This is used in mg.c:mg_set()
+        * contiguous with the argv[].  This is used in mg.c:Perl_magic_set()
         * as the maximum modifiable length of $0.  In the worst case
         * the area we are able to modify is limited to the size of
         * the original argv[0].  (See below for 'contiguous', though.)
@@ -1047,7 +1044,7 @@ setuid perl scripts securely.\n");
                   }
              }
         }
-        PL_origalen = s - PL_origargv[0];
+        PL_origalen = s - PL_origargv[0] + 1;
     }
 
     if (PL_do_undump) {
@@ -1361,7 +1358,6 @@ print \"  \\@INC:\\n    @INC\\n\";");
        }
     }
   switch_end:
-    sv_setsv(get_sv("/", TRUE), PL_rs);
 
     if (
 #ifndef SECURE_INTERNAL_GETENV
@@ -1699,7 +1695,8 @@ S_run_body(pTHX_ I32 oldscope)
 
     if (!PL_restartop) {
        DEBUG_x(dump_all());
-       PERL_DEBUG(PerlIO_printf(Perl_debug_log, "\nEXECUTING...\n\n"));
+       if (!DEBUG_q_TEST)
+         PERL_DEBUG(PerlIO_printf(Perl_debug_log, "\nEXECUTING...\n\n"));
        DEBUG_S(PerlIO_printf(Perl_debug_log, "main thread is 0x%"UVxf"\n",
                              PTR2UV(thr)));
 
@@ -2321,7 +2318,7 @@ Perl_get_debug_opts(pTHX_ char **s)
     int i = 0;
     if (isALPHA(**s)) {
        /* if adding extra options, remember to update DEBUG_MASK */
-       static char debopts[] = "psltocPmfrxu HXDSTRJvC";
+       static char debopts[] = "psltocPmfrxu HXDSTRJvCAq";
 
        for (; isALNUM(**s); (*s)++) {
            char *d = strchr(debopts,**s);
@@ -2391,6 +2388,7 @@ Perl_moreswitches(pTHX_ char *s)
                   PL_rs = newSVpvn(&ch, 1);
              }
         }
+        sv_setsv(get_sv("/", TRUE), PL_rs);
         return s + numlen;
     }
     case 'C':