diff options
author | Father Chrysostomos <sprout@cpan.org> | 2012-11-20 17:52:13 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2012-11-20 17:58:57 -0800 |
commit | fef5350ad7ccf261f50ed1b6cb771ee5bb4f6ade (patch) | |
tree | b13f53fbb291f8e98fb1086d3443d199cd46d2e8 /sv.c | |
parent | ac55090a985ffce20a3f39ce0344fd33448dfdb9 (diff) | |
download | perl-fef5350ad7ccf261f50ed1b6cb771ee5bb4f6ade.tar.gz |
[perl #115830] Fix crash by not copying DESTROY cache
See commits 8c34e50dc and 7cc6787e9db (the latter was reverted by
95f9781bc).
If we are going to store a DESTROY cache in SvSTASH when !SvOBJECT, we
have to make sure not to copy that cache, otherwise other threads will
try to call a CV in the first thread, resulting in a crash.
8c34e50dc introduced this bug, but the crash didn’t start happening
until 7cc6787e9db, and only on Windows.
Diffstat (limited to 'sv.c')
-rw-r--r-- | sv.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -12002,6 +12002,7 @@ S_sv_dup_common(pTHX_ const SV *const sstr, CLONE_PARAMS *const param) SvMAGIC_set(dstr, mg_dup(SvMAGIC(dstr), param)); if (SvSTASH(dstr)) SvSTASH_set(dstr, hv_dup_inc(SvSTASH(dstr), param)); + else SvSTASH_set(dstr, 0); /* don't copy DESTROY cache */ } /* The cast silences a GCC warning about unhandled types. */ |