summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2001-01-16 03:42:55 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-01-16 03:42:55 +0000
commit7d3de3d540c289e16b68f6cc341028f48c070231 (patch)
tree8b01009434cebb93f35a3a0b0dec7373f0e7c845 /util.c
parentc03c28449e79a2a6287a0aa1cdd5d6637750d5c3 (diff)
downloadperl-7d3de3d540c289e16b68f6cc341028f48c070231.tar.gz
Under 5.005 threads and debugging crashed in Debian 2.2 Linux/x86
at the setting of the ofs_sv in new_struct_thread() as the thr->Tofs_sv (PL_ofs_sv) was still 0xabab.... (this is what uninitialized fields are, uh, initialized with), SvREFCNT_inc()ing that invited a core dump. p4raw-id: //depot/perl@8449
Diffstat (limited to 'util.c')
-rw-r--r--util.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/util.c b/util.c
index 27c6953a90..b163b05361 100644
--- a/util.c
+++ b/util.c
@@ -3645,9 +3645,9 @@ Perl_new_struct_thread(pTHX_ struct perl_thread *t)
PL_tainted = t->Ttainted;
PL_curpm = t->Tcurpm; /* XXX No PMOP ref count */
PL_nrs = newSVsv(t->Tnrs);
- PL_rs = SvREFCNT_inc(PL_nrs);
+ PL_rs = t->Tnrs ? SvREFCNT_inc(PL_nrs) : Nullsv;
PL_last_in_gv = Nullgv;
- PL_ofs_sv = SvREFCNT_inc(PL_ofs_sv);
+ PL_ofs_sv = t->Tofs_sv ? SvREFCNT_inc(PL_ofs_sv) : Nullsv;
PL_defoutgv = (GV*)SvREFCNT_inc(t->Tdefoutgv);
PL_chopset = t->Tchopset;
PL_bodytarget = newSVsv(t->Tbodytarget);