This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
undef IS_UTF8_CHAR() on EBCDIC
[perl5.git] / scope.c
diff --git a/scope.c b/scope.c
index 7e2b129..5ef74ec 100644 (file)
--- a/scope.c
+++ b/scope.c
@@ -46,7 +46,7 @@ PERL_SI *
 Perl_new_stackinfo(pTHX_ I32 stitems, I32 cxitems)
 {
     PERL_SI *si;
-    New(56, si, 1, PERL_SI);
+    Newx(si, 1, PERL_SI);
     si->si_stack = newAV();
     AvREAL_off(si->si_stack);
     av_extend(si->si_stack, stitems > 0 ? stitems-1 : 0);
@@ -57,7 +57,7 @@ Perl_new_stackinfo(pTHX_ I32 stitems, I32 cxitems)
     si->si_cxmax = cxitems - 1;
     si->si_cxix = -1;
     si->si_type = PERLSI_UNDEF;
-    New(56, si->si_cxstack, cxitems, PERL_CONTEXT);
+    Newx(si->si_cxstack, cxitems, PERL_CONTEXT);
     /* Without any kind of initialising PUSHSUBST()
      * in pp_subst() will read uninitialised heap. */
     Poison(si->si_cxstack, cxitems, PERL_CONTEXT);
@@ -170,7 +170,9 @@ SV *
 Perl_save_scalar(pTHX_ GV *gv)
 {
     SV **sptr = &GvSV(gv);
+    PL_localizing = 1;
     SvGETMAGIC(*sptr);
+    PL_localizing = 0;
     SSCHECK(3);
     SSPUSHPTR(SvREFCNT_inc(gv));
     SSPUSHPTR(SvREFCNT_inc(*sptr));
@@ -252,7 +254,7 @@ Perl_save_gp(pTHX_ GV *gv, I32 empty)
     if (empty) {
        register GP *gp;
 
-       Newz(602, gp, 1, GP);
+       Newxz(gp, 1, GP);
 
        if (GvCVu(gv))
            PL_sub_generation++;        /* taking a method out of circulation */
@@ -430,7 +432,7 @@ SV **
 Perl_save_threadsv(pTHX_ PADOFFSET i)
 {
     Perl_croak(aTHX_ "panic: save_threadsv called in non-threaded perl");
-    (void)i;
+    PERL_UNUSED_ARG(i);
     NORETURN_FUNCTION_END;
 }
 
@@ -781,7 +783,7 @@ Perl_leave_scope(pTHX_ I32 base)
            ptr = SSPOPPTR;
            gv = (GV*)SSPOPPTR;
            if (SvPVX_const(gv) && SvLEN(gv) > 0) {
-               Safefree(SvPVX_const(gv));
+               Safefree(SvPVX_mutable(gv));
            }
            SvPV_set(gv, (char *)SSPOPPTR);
            SvCUR_set(gv, (STRLEN)SSPOPIV);