summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1998-05-18 09:40:58 +0000
committerGurusamy Sarathy <gsar@cpan.org>1998-05-18 09:40:58 +0000
commit3666098248b43282bda1153dae2f4c1e4af38d09 (patch)
tree9c69a323f89cdd81b231dc630b0eaf134225da7a /sv.c
parent9e6b2b00f0190751b970ece3db7033405cb08ca5 (diff)
parentd2719217c9b7910115cef7ea0c16d68e6b286cf7 (diff)
downloadperl-3666098248b43282bda1153dae2f4c1e4af38d09.tar.gz
[asperl] integrate mainline changes (untested)
p4raw-id: //depot/asperl@1010
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c29
1 files changed, 20 insertions, 9 deletions
diff --git a/sv.c b/sv.c
index 9de43336d3..390749db94 100644
--- a/sv.c
+++ b/sv.c
@@ -1912,8 +1912,11 @@ sv_setsv(SV *dstr, register SV *sstr)
switch (stype) {
case SVt_NULL:
- (void)SvOK_off(dstr);
- return;
+ if (dtype != SVt_PVGV) {
+ (void)SvOK_off(dstr);
+ return;
+ }
+ break;
case SVt_IV:
if (dtype != SVt_IV && dtype < SVt_PVIV) {
if (dtype < SVt_IV)
@@ -2215,7 +2218,12 @@ sv_setsv(SV *dstr, register SV *sstr)
SvIVX(dstr) = SvIVX(sstr);
}
else {
- (void)SvOK_off(dstr);
+ if (dtype == SVt_PVGV) {
+ if (dowarn)
+ warn("Undefined value assigned to typeglob");
+ }
+ else
+ (void)SvOK_off(dstr);
}
SvTAINT(dstr);
}
@@ -2427,11 +2435,7 @@ sv_catpv_mg(register SV *sv, register char *ptr)
}
SV *
-#ifdef LEAKTEST
-newSV(I32 x, STRLEN len)
-#else
newSV(STRLEN len)
-#endif
{
register SV *sv;
@@ -2640,10 +2644,17 @@ sv_insert(SV *bigstr, STRLEN offset, STRLEN len, char *little, STRLEN littlelen)
register char *midend;
register char *bigend;
register I32 i;
+ STRLEN curlen;
+
if (!bigstr)
croak("Can't modify non-existent substring");
- SvPV_force(bigstr, na);
+ SvPV_force(bigstr, curlen);
+ if (offset + len > curlen) {
+ SvGROW(bigstr, offset+len+1);
+ Zero(SvPVX(bigstr)+curlen, offset+len-curlen, char);
+ SvCUR_set(bigstr, offset+len);
+ }
i = littlelen - len;
if (i > 0) { /* string might grow */
@@ -3703,7 +3714,7 @@ sv_reset(register char *s, HV *stash)
if (!*s) { /* reset ?? searches */
for (pm = HvPMROOT(stash); pm; pm = pm->op_pmnext) {
- pm->op_pmflags &= ~PMf_USED;
+ pm->op_pmdynflags &= ~PMdf_USED;
}
return;
}