Jerry D. Hedden [Tue, 13 Dec 2005 15:11:20 +0000 (07:11 -0800)]
From: "Jerry D. Hedden" (via RT) <perlbug-followup@perl.org>
Message-Id: <rt-3.0.11-37919-125690.15.
3722450337035@perl.org>
Unlike arrays and hashes, coping blessed refs to shared scalars left
the copy unblessed
p4raw-id: //depot/perl@26350
ext/threads/shared/t/0nothread.t Tests for basic shared array functionality.
ext/threads/shared/t/av_refs.t Tests for arrays containing references
ext/threads/shared/t/av_simple.t Tests for basic shared array functionality.
+ext/threads/shared/t/blessed.t Test blessed shared variables
ext/threads/shared/t/cond.t Test condition variables
ext/threads/shared/t/disabled.t Test threads::shared when threads are disabled.
ext/threads/shared/t/hv_refs.t Test shared hashes containing references
&sharedsv_scalar_vtbl, (char *)data, 0);
mg->mg_flags |= (MGf_COPY|MGf_DUP);
SvREFCNT_inc(ssv);
+ if(SvOBJECT(ssv)) {
+ STRLEN len;
+ char* stash_ptr = SvPV((SV*) SvSTASH(ssv), len);
+ HV* stash = gv_stashpvn(stash_ptr, len, TRUE);
+ SvOBJECT_on(sv);
+ SvSTASH_set(sv, (HV*)SvREFCNT_inc(stash));
+ }
}
break;
}