summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2005-06-29 19:25:24 +0000
committerNicholas Clark <nick@ccl4.org>2005-06-29 19:25:24 +0000
commite203899dcaadab28f2ff9e515fbc895686054f71 (patch)
tree22948c5798417be634b104f753423112d77fb415
parentc69033f2a629160559f680da8e4e5a7e3c4c3a0c (diff)
downloadperl-e203899dcaadab28f2ff9e515fbc895686054f71.tar.gz
Fixes to -DPERL_DONT_CREATE_GVSV to make more tests pass
p4raw-id: //depot/perl@25010
-rw-r--r--doio.c2
-rw-r--r--gv.c2
-rw-r--r--perl.h3
-rw-r--r--sv.c26
4 files changed, 19 insertions, 14 deletions
diff --git a/doio.c b/doio.c
index a2300fc189..b62a473824 100644
--- a/doio.c
+++ b/doio.c
@@ -773,7 +773,7 @@ Perl_nextargv(pTHX_ register GV *gv)
STRLEN oldlen;
sv = av_shift(GvAV(gv));
SAVEFREESV(sv);
- sv_setsv(GvSV(gv),sv);
+ sv_setsv(GvSVn(gv),sv);
SvSETMAGIC(GvSV(gv));
PL_oldname = SvPVx(GvSV(gv), oldlen);
if (do_open(gv,PL_oldname,oldlen,PL_inplace!=0,O_RDONLY,0,Nullfp)) {
diff --git a/gv.c b/gv.c
index e6993ad2d2..39f4b6ad93 100644
--- a/gv.c
+++ b/gv.c
@@ -582,7 +582,7 @@ Perl_gv_autoload4(pTHX_ HV *stash, const char *name, STRLEN len, I32 method)
#endif
}
LEAVE;
- varsv = GvSV(vargv);
+ varsv = GvSVn(vargv);
sv_setpvn(varsv, packname, packname_len);
sv_catpvn(varsv, "::", 2);
sv_catpvn(varsv, name, len);
diff --git a/perl.h b/perl.h
index 1335096b17..9de12912f6 100644
--- a/perl.h
+++ b/perl.h
@@ -1126,7 +1126,8 @@ int sockatmark(int);
#endif
#define ERRSV GvSV(PL_errgv)
-#define DEFSV GvSV(PL_defgv)
+/* FIXME? Change the assignments to PL_defgv to instantiate GvSV? */
+#define DEFSV GvSVn(PL_defgv)
#define SAVE_DEFSV SAVESPTR(GvSV(PL_defgv))
#define ERRHV GvHV(PL_errgv) /* XXX unused, here for compatibility */
diff --git a/sv.c b/sv.c
index 3d1223239d..c217558e1b 100644
--- a/sv.c
+++ b/sv.c
@@ -7566,17 +7566,21 @@ Perl_sv_reset(pTHX_ register const char *s, HV *stash)
continue;
gv = (GV*)HeVAL(entry);
sv = GvSV(gv);
- if (SvTHINKFIRST(sv)) {
- if (!SvREADONLY(sv) && SvROK(sv))
- sv_unref(sv);
- continue;
- }
- SvOK_off(sv);
- if (SvTYPE(sv) >= SVt_PV) {
- SvCUR_set(sv, 0);
- if (SvPVX_const(sv) != Nullch)
- *SvPVX(sv) = '\0';
- SvTAINT(sv);
+ if (sv) {
+ if (SvTHINKFIRST(sv)) {
+ if (!SvREADONLY(sv) && SvROK(sv))
+ sv_unref(sv);
+ /* XXX Is this continue a bug? Why should THINKFIRST
+ exempt us from resetting arrays and hashes? */
+ continue;
+ }
+ SvOK_off(sv);
+ if (SvTYPE(sv) >= SVt_PV) {
+ SvCUR_set(sv, 0);
+ if (SvPVX_const(sv) != Nullch)
+ *SvPVX(sv) = '\0';
+ SvTAINT(sv);
+ }
}
if (GvAV(gv)) {
av_clear(GvAV(gv));