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);
+ PoisonNew(si->si_cxstack, cxitems, PERL_CONTEXT);
return si;
}
Renew(cxstack, cxstack_max + 1, PERL_CONTEXT); /* XXX should fix CXINC macro */
/* Without any kind of initialising deep enough recursion
* will end up reading uninitialised PERL_CONTEXTs. */
- Poison(cxstack + old_max + 1, cxstack_max - old_max, PERL_CONTEXT);
+ PoisonNew(cxstack + old_max + 1, cxstack_max - old_max, PERL_CONTEXT);
return cxstack_ix + 1;
}
{
dVAR;
SSCHECK(3);
- SSPUSHPTR(str);
SSPUSHPTR(*str);
+ SSPUSHPTR(str);
SSPUSHINT(SAVEt_GENERIC_PVREF);
}
- (char*)PL_savestack);
register const I32 elems = 1 + ((size + pad - 1) / sizeof(*PL_savestack));
- /* SSCHECK may not be good enough */
- while (PL_savestack_ix + elems + 2 > PL_savestack_max)
- savestack_grow();
+ SSGROW(elems + 2);
PL_savestack_ix += elems;
SSPUSHINT(elems);
SvREFCNT_dec(av);
break;
case SAVEt_GENERIC_PVREF: /* generic pv */
- str = (char*)SSPOPPTR;
ptr = SSPOPPTR;
+ str = (char*)SSPOPPTR;
if (*(char**)ptr != str) {
Safefree(*(char**)ptr);
*(char**)ptr = str;
ptr = SSPOPPTR;
Safefree(ptr);
break;
+ case SAVEt_FREESHAREDPV:
+ ptr = SSPOPPTR;
+ PerlMemShared_free(ptr);
+ break;
case SAVEt_CLEARSV:
ptr = (void*)&PL_curpad[SSPOPLONG];
sv = *(SV**)ptr;
ptr = SSPOPPTR;
hv = (HV*)ptr;
ptr = SSPOPPTR;
- (void)hv_delete(hv, (char*)ptr, (U32)SSPOPINT, G_DISCARD);
+ (void)hv_delete(hv, (char*)ptr, (I32)SSPOPINT, G_DISCARD);
SvREFCNT_dec(hv);
Safefree(ptr);
break;
GvHV(PL_hintgv) = NULL;
}
*(I32*)&PL_hints = (I32)SSPOPINT;
+ Perl_refcounted_he_free(aTHX_ PL_compiling.cop_hints);
+ PL_compiling.cop_hints = (struct refcounted_he *) SSPOPPTR;
if (PL_hints & HINT_LOCALIZE_HH) {
SvREFCNT_dec((SV*)GvHV(PL_hintgv));
GvHV(PL_hintgv) = (HV*)SSPOPPTR;
+ assert(GvHV(PL_hintgv));
+ } else if (!GvHV(PL_hintgv)) {
+ /* Need to add a new one manually, else gv_fetchpv() can
+ add one in this code:
+
+ if (SvTYPE(gv) == SVt_PVGV) {
+ if (add) {
+ GvMULTI_on(gv);
+ gv_init_sv(gv, sv_type);
+ if (*name=='!' && sv_type == SVt_PVHV && len==1)
+ require_errno(gv);
+ }
+ return gv;
+ }
+
+ and it won't have the magic set. */
+
+ HV *const hv = newHV();
+ hv_magic(hv, NULL, PERL_MAGIC_hints);
+ GvHV(PL_hintgv) = hv;
}
-
+ assert(GvHV(PL_hintgv));
break;
case SAVEt_COMPPAD:
PL_comppad = (PAD*)SSPOPPTR;
ptr = SSPOPPTR;
(*SSPOPDPTR)(ptr);
break;
+ case SAVEt_COP_ARYBASE:
+ ptr = SSPOPPTR;
+ i = SSPOPINT;
+ CopARYBASE_set((COP *)ptr, i);
+ break;
+ case SAVEt_COP_WARNINGS:
+ {
+ COP *const cop = SSPOPPTR;
+ ptr = SSPOPPTR;
+
+ if (!specialWARN(cop->cop_warnings))
+ PerlMemShared_free(cop->cop_warnings);
+
+ cop->cop_warnings = ptr;
+ }
+ break;
+ case SAVEt_RE_STATE:
+ {
+ const struct re_save_state *const state
+ = (struct re_save_state *)
+ (PL_savestack + PL_savestack_ix
+ - SAVESTACK_ALLOC_FOR_RE_SAVE_STATE);
+ PL_savestack_ix -= SAVESTACK_ALLOC_FOR_RE_SAVE_STATE;
+
+ if (PL_reg_start_tmp != state->re_state_reg_start_tmp) {
+ Safefree(PL_reg_start_tmp);
+ }
+ if (PL_reg_poscache != state->re_state_reg_poscache) {
+ Safefree(PL_reg_poscache);
+ }
+ Copy(state, &PL_reg_state, 1, struct re_save_state);
+ }
+ break;
default:
Perl_croak(aTHX_ "panic: leave_scope inconsistency");
}