The empty %INC created for safe compartements was freed
too early.
p4raw-id: //depot/perl@21628
PPCODE:
char op_mask_buf[OP_MASK_BUF_SIZE];
GV *gv;
+ HV *dummy_hv;
ENTER;
GvHV(gv) = (HV*)SvREFCNT_inc(PL_defstash);
/* %INC must be clean for use/require in compartment */
- save_hash(PL_incgv);
- sv_free((SV*)GvHV(PL_incgv)); /* get rid of what save_hash gave us*/
+ dummy_hv = save_hash(PL_incgv);
GvHV(PL_incgv) = (HV*)SvREFCNT_inc(GvHV(gv_HVadd(gv_fetchpv("INC",TRUE,SVt_PVHV))));
PUSHMARK(SP);
perl_call_sv(codesv, GIMME|G_EVAL|G_KEEPERR); /* use callers context */
+ sv_free(dummy_hv); /* get rid of what save_hash gave us*/
SPAGAIN; /* for the PUTBACK added by xsubpp */
LEAVE;