diff options
author | Dave Mitchell <davem@fdisolutions.com> | 2004-10-29 21:04:17 +0000 |
---|---|---|
committer | Dave Mitchell <davem@fdisolutions.com> | 2004-10-29 21:04:17 +0000 |
commit | b34c0dd4a7081ed822e2197d6a723d2ab2fdfc86 (patch) | |
tree | 79e12d9672fac988f06daf38b445e954c784b00e /sv.c | |
parent | 2d8d5d5aa55d3bc73a36db1fc2d8bcfe8bb20516 (diff) | |
download | perl-b34c0dd4a7081ed822e2197d6a723d2ab2fdfc86.tar.gz |
[perl #31851] Threading crash with closures
various OpREFCNT_inc() operations weren't doing locking
p4raw-id: //depot/perl@23433
Diffstat (limited to 'sv.c')
-rw-r--r-- | sv.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -10244,7 +10244,9 @@ Perl_re_dup(pTHX_ REGEXP *r, CLONE_PARAMS *param) case 'o': /* Compiled op trees are readonly, and can thus be shared without duplication. */ + OP_REFCNT_LOCK; d->data[i] = (void*)OpREFCNT_inc((OP*)r->data->data[i]); + OP_REFCNT_UNLOCK; break; case 'n': d->data[i] = r->data->data[i]; @@ -10955,7 +10957,9 @@ Perl_sv_dup(pTHX_ SV *sstr, CLONE_PARAMS* param) Perl_rvpv_dup(aTHX_ dstr, sstr, param); CvSTASH(dstr) = hv_dup(CvSTASH(sstr), param); /* NOTE: not refcounted */ CvSTART(dstr) = CvSTART(sstr); + OP_REFCNT_LOCK; CvROOT(dstr) = OpREFCNT_inc(CvROOT(sstr)); + OP_REFCNT_UNLOCK; CvXSUB(dstr) = CvXSUB(sstr); CvXSUBANY(dstr) = CvXSUBANY(sstr); if (CvCONST(sstr)) { |