Skip to content

Commit

Permalink
C -O3: also clear the stashcache here
Browse files Browse the repository at this point in the history
better DESTROY the objects with a pristine stashcache.
got corrupt stashcache entries in global DBI destruction,
even with -O3.
  • Loading branch information
Reini Urban committed Mar 23, 2016
1 parent 2230e5c commit 4e4b5da
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion lib/B/C.pm
Expand Up @@ -6788,10 +6788,12 @@ _EOT8
#endif
if (PL_sv_objcount) {
PL_stashcache = newHV(); /* Hack: sometimes corrupted, holding a GV */
PL_in_clean_all = 1;
sv_clean_objs(); /* and now curse the rest */
sv_clean_objs(); /* and now curse the rest */
PL_sv_objcount = 0;
}
PL_warnhook = NULL;
PL_diehook = NULL;
/* call exit list functions */
Expand All @@ -6802,6 +6804,14 @@ _EOT8
#if defined(PERLIO_LAYERS)
PerlIO_cleanup(aTHX);
#endif
PL_stashcache = (HV*)&PL_sv_undef;
/* Silence strtab refcnt warnings during global destruction */
Zero(HvARRAY(PL_strtab), HvMAX(PL_strtab), HE*);
/* NULL the HEK "dfs" */
PL_registered_mros = (HV*)&PL_sv_undef;
CopHINTHASH_set(&PL_compiling, NULL);
return 0;
}
_EOT9
Expand Down Expand Up @@ -6879,6 +6889,14 @@ _EOT7
sva, sva+SvREFCNT(sva), (long)SvREFCNT(sva));
}
}
PL_stashcache = (HV*)&PL_sv_undef;
/* Silence strtab refcnt warnings during global destruction */
Zero(HvARRAY(PL_strtab), HvMAX(PL_strtab), HE*);
/* NULL the HEK "dfs" */
PL_registered_mros = (HV*)&PL_sv_undef;
CopHINTHASH_set(&PL_compiling, NULL);
return perl_destruct( my_perl );
#else
perl_destruct( my_perl );
Expand Down

0 comments on commit 4e4b5da

Please sign in to comment.