summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Ing-Simmons <nik@tiuk.ti.com>1998-07-18 08:18:03 +0000
committerNick Ing-Simmons <nik@tiuk.ti.com>1998-07-18 08:18:03 +0000
commitef6361f9c2260919aefcc17b1b80f8857c67a84a (patch)
tree7c016613302b69a06e7c547ec6a4146ca68f936d
parente61966e30c34a0bab248661dd25212b5e32bb517 (diff)
parent02270b4e1187bc8d0def222ae3fb78581e1dc745 (diff)
downloadperl-ef6361f9c2260919aefcc17b1b80f8857c67a84a.tar.gz
Integrate post-beta tweaks to ansiperl
p4raw-id: //depot/ansiperl@1529
-rw-r--r--ObjXSub.h2
-rw-r--r--embed.h1
-rw-r--r--ext/Thread/Thread.xs2
-rw-r--r--global.sym1
-rw-r--r--gv.c3
-rw-r--r--mg.c7
-rw-r--r--objpp.h2
-rw-r--r--op.c3
-rw-r--r--perl.c11
-rw-r--r--perl.h2
-rw-r--r--pp_sys.c2
-rw-r--r--proto.h1
-rw-r--r--sv.c4
-rwxr-xr-xt/op/substr.t2
-rwxr-xr-xt/op/vec.t2
-rw-r--r--toke.c3
-rw-r--r--util.c3
17 files changed, 20 insertions, 31 deletions
diff --git a/ObjXSub.h b/ObjXSub.h
index f8adba8337..824da89888 100644
--- a/ObjXSub.h
+++ b/ObjXSub.h
@@ -1103,8 +1103,6 @@
#define magic_clearsig pPerl->Perl_magic_clearsig
#undef magic_existspack
#define magic_existspack pPerl->Perl_magic_existspack
-#undef magic_freedefelem
-#define magic_freedefelem pPerl->Perl_magic_freedefelem
#undef magic_freeregexp
#define magic_freeregexp pPerl->Perl_magic_freeregexp
#undef magic_get
diff --git a/embed.h b/embed.h
index 5bf672572f..e7f8a50fcf 100644
--- a/embed.h
+++ b/embed.h
@@ -278,7 +278,6 @@
#define magic_clearpack Perl_magic_clearpack
#define magic_clearsig Perl_magic_clearsig
#define magic_existspack Perl_magic_existspack
-#define magic_freedefelem Perl_magic_freedefelem
#define magic_freeregexp Perl_magic_freeregexp
#define magic_get Perl_magic_get
#define magic_getarylen Perl_magic_getarylen
diff --git a/ext/Thread/Thread.xs b/ext/Thread/Thread.xs
index be1e7af560..5d47cd0251 100644
--- a/ext/Thread/Thread.xs
+++ b/ext/Thread/Thread.xs
@@ -158,6 +158,8 @@ threadstart(void *arg)
Safefree(tmps_stack);
Safefree(ofs);
+ SvREFCNT_dec(rs);
+ SvREFCNT_dec(nrs);
SvREFCNT_dec(statname);
Safefree(screamfirst);
Safefree(screamnext);
diff --git a/global.sym b/global.sym
index 11f09f827e..9a9ada6e7a 100644
--- a/global.sym
+++ b/global.sym
@@ -377,7 +377,6 @@ magic_clearenv
magic_clearpack
magic_clearsig
magic_existspack
-magic_freedefelem
magic_freeregexp
magic_get
magic_getarylen
diff --git a/gv.c b/gv.c
index 505f6339e5..4adce49408 100644
--- a/gv.c
+++ b/gv.c
@@ -124,7 +124,8 @@ gv_init(GV *gv, HV *stash, char *name, STRLEN len, int multi)
CvSTASH(GvCV(gv)) = curstash;
#ifdef USE_THREADS
CvOWNER(GvCV(gv)) = 0;
- New(666, CvMUTEXP(GvCV(gv)), 1, perl_mutex);
+ if (!CvMUTEXP(GvCV(gv)))
+ New(666, CvMUTEXP(GvCV(gv)), 1, perl_mutex);
MUTEX_INIT(CvMUTEXP(GvCV(gv)));
#endif /* USE_THREADS */
if (proto) {
diff --git a/mg.c b/mg.c
index 09441b3363..faceff4a3a 100644
--- a/mg.c
+++ b/mg.c
@@ -1386,13 +1386,6 @@ magic_setdefelem(SV *sv, MAGIC *mg)
return 0;
}
-int
-magic_freedefelem(SV *sv, MAGIC *mg)
-{
- SvREFCNT_dec(LvTARG(sv));
- return 0;
-}
-
void
vivify_defelem(SV *sv)
{
diff --git a/objpp.h b/objpp.h
index d65a5b8f6b..e0c2f24ff1 100644
--- a/objpp.h
+++ b/objpp.h
@@ -555,8 +555,6 @@
#define magic_clearsig CPerlObj::Perl_magic_clearsig
#undef magic_existspack
#define magic_existspack CPerlObj::Perl_magic_existspack
-#undef magic_freedefelem
-#define magic_freedefelem CPerlObj::Perl_magic_freedefelem
#undef magic_freeregexp
#define magic_freeregexp CPerlObj::Perl_magic_freeregexp
#undef magic_get
diff --git a/op.c b/op.c
index ecefb838e0..a123b58e78 100644
--- a/op.c
+++ b/op.c
@@ -3532,7 +3532,8 @@ newSUB(I32 floor, OP *o, OP *proto, OP *block)
CvSTASH(cv) = curstash;
#ifdef USE_THREADS
CvOWNER(cv) = 0;
- New(666, CvMUTEXP(cv), 1, perl_mutex);
+ if (!CvMUTEXP(cv))
+ New(666, CvMUTEXP(cv), 1, perl_mutex);
MUTEX_INIT(CvMUTEXP(cv));
#endif /* USE_THREADS */
diff --git a/perl.c b/perl.c
index 9e29975cfc..fe1df904c3 100644
--- a/perl.c
+++ b/perl.c
@@ -164,9 +164,6 @@ perl_construct(register PerlInterpreter *sv_interp)
SvREFCNT(&sv_yes) = (~(U32)0)/2;
}
- nrs = newSVpv("\n", 1);
- rs = SvREFCNT_inc(nrs);
-
#ifdef PERL_OBJECT
/* TODO: */
/* sighandlerp = sighandler; */
@@ -186,6 +183,9 @@ perl_construct(register PerlInterpreter *sv_interp)
#endif
}
+ nrs = newSVpv("\n", 1);
+ rs = SvREFCNT_inc(nrs);
+
init_stacks(ARGS);
#ifdef MULTIPLICITY
init_interp();
@@ -428,7 +428,10 @@ perl_destruct(register PerlInterpreter *sv_interp)
Safefree(ors); /* $\ */
ors = Nullch;
- SvREFCNT_dec(nrs); /* $\ helper */
+ SvREFCNT_dec(rs); /* $/ */
+ rs = Nullsv;
+
+ SvREFCNT_dec(nrs); /* $/ helper */
nrs = Nullsv;
multiline = 0; /* $* */
diff --git a/perl.h b/perl.h
index 6d4cea7c07..b05119d6d9 100644
--- a/perl.h
+++ b/perl.h
@@ -2078,7 +2078,7 @@ EXT MGVTBL vtbl_uvar = {magic_getuvar,
EXT MGVTBL vtbl_mutex = {0, 0, 0, 0, magic_mutexfree};
#endif /* USE_THREADS */
EXT MGVTBL vtbl_defelem = {magic_getdefelem,magic_setdefelem,
- 0, 0, magic_freedefelem};
+ 0, 0, 0};
EXT MGVTBL vtbl_regexp = {0,0,0,0, magic_freeregexp};
diff --git a/pp_sys.c b/pp_sys.c
index fe75220d38..f8807197a7 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -1329,7 +1329,7 @@ PP(pp_sysread)
{
length = PerlIO_read(IoIFP(io), buffer+offset, length);
/* fread() returns 0 on both error and EOF */
- if (PerlIO_error(IoIFP(io)))
+ if (length == 0 && PerlIO_error(IoIFP(io)))
length = -1;
}
if (length < 0)
diff --git a/proto.h b/proto.h
index 59b2488c24..2908222917 100644
--- a/proto.h
+++ b/proto.h
@@ -209,7 +209,6 @@ VIRTUAL int magic_clear_all_env _((SV* sv, MAGIC* mg));
VIRTUAL int magic_clearpack _((SV* sv, MAGIC* mg));
VIRTUAL int magic_clearsig _((SV* sv, MAGIC* mg));
VIRTUAL int magic_existspack _((SV* sv, MAGIC* mg));
-VIRTUAL int magic_freedefelem _((SV* sv, MAGIC* mg));
VIRTUAL int magic_freeregexp _((SV* sv, MAGIC* mg));
VIRTUAL int magic_get _((SV* sv, MAGIC* mg));
VIRTUAL int magic_getarylen _((SV* sv, MAGIC* mg));
diff --git a/sv.c b/sv.c
index 46b51a344f..29c45fd37a 100644
--- a/sv.c
+++ b/sv.c
@@ -2905,6 +2905,9 @@ sv_clear(register SV *sv)
case SVt_PVAV:
av_undef((AV*)sv);
break;
+ case SVt_PVLV:
+ SvREFCNT_dec(LvTARG(sv));
+ goto freescalar;
case SVt_PVGV:
gp_free((GV*)sv);
Safefree(GvNAME(sv));
@@ -2914,7 +2917,6 @@ sv_clear(register SV *sv)
-- JohnPC, 27 Mar 1998 */
stash = GvSTASH(sv);
/* FALL THROUGH */
- case SVt_PVLV:
case SVt_PVMG:
case SVt_PVNV:
case SVt_PVIV:
diff --git a/t/op/substr.t b/t/op/substr.t
index fe53f01552..87efcb4512 100755
--- a/t/op/substr.t
+++ b/t/op/substr.t
@@ -2,8 +2,6 @@
print "1..106\n";
-$ENV{PERL_DESTRUCT_LEVEL} = 0; # XXX known to leaks scalars
-
#P = start of string Q = start of substr R = end of substr S = end of string
$a = 'abcdefxyz';
diff --git a/t/op/vec.t b/t/op/vec.t
index 5ae224703a..71171447d6 100755
--- a/t/op/vec.t
+++ b/t/op/vec.t
@@ -4,8 +4,6 @@
print "1..15\n";
-$ENV{PERL_DESTRUCT_LEVEL} = 0; # XXX known to leaks scalars
-
print vec($foo,0,1) == 0 ? "ok 1\n" : "not ok 1\n";
print length($foo) == 0 ? "ok 2\n" : "not ok 2\n";
vec($foo,0,1) = 1;
diff --git a/toke.c b/toke.c
index db8775859a..9685fc3e32 100644
--- a/toke.c
+++ b/toke.c
@@ -5967,9 +5967,6 @@ start_subparse(I32 is_format, U32 flags)
av_store(comppad_name, 0, newSVpv("@_", 2));
curpad[0] = (SV*)newAV();
SvPADMY_on(curpad[0]); /* XXX Needed? */
- CvOWNER(compcv) = 0;
- New(666, CvMUTEXP(compcv), 1, perl_mutex);
- MUTEX_INIT(CvMUTEXP(compcv));
#endif /* USE_THREADS */
comppadlist = newAV();
diff --git a/util.c b/util.c
index 1d417e7de7..eb52ee5a2c 100644
--- a/util.c
+++ b/util.c
@@ -2783,7 +2783,7 @@ new_struct_thread(struct perl_thread *t)
tainted = t->Ttainted;
curpm = t->Tcurpm; /* XXX No PMOP ref count */
nrs = newSVsv(t->Tnrs);
- rs = newSVsv(t->Trs);
+ rs = SvREFCNT_inc(nrs);
last_in_gv = (GV*)SvREFCNT_inc(t->Tlast_in_gv);
ofslen = t->Tofslen;
ofs = savepvn(t->Tofs, ofslen);
@@ -2803,6 +2803,7 @@ new_struct_thread(struct perl_thread *t)
screamfirst = 0;
screamnext = 0;
reg_start_tmp = 0;
+ reg_start_tmpl = 0;
/* Initialise all per-thread SVs that the template thread used */
svp = AvARRAY(t->threadsv);