This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Replaced two occurrences of THREADSV(find_thread_sv(...)) (order
authorMalcolm Beattie <mbeattie@sable.ox.ac.uk>
Tue, 3 Feb 1998 16:00:07 +0000 (16:00 +0000)
committerMalcolm Beattie <mbeattie@sable.ox.ac.uk>
Tue, 3 Feb 1998 16:00:07 +0000 (16:00 +0000)
of execution causes core dump if threadsvp is moved). Replaced
lvalue occurrence of AvARRAY(av) with SvPVX(av) (former does cast).

p4raw-id: //depot/perl@459

av.c
perl.c

diff --git a/av.c b/av.c
index 20c77d8..ae5ffab 100644 (file)
--- a/av.c
+++ b/av.c
@@ -367,7 +367,7 @@ av_undef(register AV *av)
            SvREFCNT_dec(AvARRAY(av)[--key]);
     }
     Safefree(AvALLOC(av));
-    AvARRAY(av) = 0;
+    SvPVX(av) = 0;
     AvALLOC(av) = 0;
     SvPVX(av) = 0;
     AvMAX(av) = AvFILLp(av) = -1;
diff --git a/perl.c b/perl.c
index 54fb772..1fa2319 100644 (file)
--- a/perl.c
+++ b/perl.c
@@ -935,11 +935,7 @@ print \"  \\@INC:\\n    @INC\\n\";");
     /* now that script is parsed, we can modify record separator */
     SvREFCNT_dec(rs);
     rs = SvREFCNT_inc(nrs);
-#ifdef USE_THREADS
-    sv_setsv(THREADSV(find_threadsv("/")), rs); 
-#else
-    sv_setsv(GvSV(gv_fetchpv("/", TRUE, SVt_PV)), rs);
-#endif /* USE_THREADS */
+    sv_setsv(perl_get_sv("/", TRUE), rs);
     if (do_undump)
        my_unexec();
 
@@ -2509,12 +2505,7 @@ init_predump_symbols(void)
     GV *tmpgv;
     GV *othergv;
 
-#ifdef USE_THREADS
-    sv_setpvn(THREADSV(find_threadsv("\"")), " ", 1);
-#else
-    sv_setpvn(GvSV(gv_fetchpv("\"", TRUE, SVt_PV)), " ", 1);
-#endif /* USE_THREADS */
-
+    sv_setpvn(perl_get_sv("\"", TRUE), " ", 1);
     stdingv = gv_fetchpv("STDIN",TRUE, SVt_PVIO);
     GvMULTI_on(stdingv);
     IoIFP(GvIOp(stdingv)) = PerlIO_stdin();