diff options
author | Nicholas Clark <nick@ccl4.org> | 2005-06-29 19:25:24 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2005-06-29 19:25:24 +0000 |
commit | e203899dcaadab28f2ff9e515fbc895686054f71 (patch) | |
tree | 22948c5798417be634b104f753423112d77fb415 | |
parent | c69033f2a629160559f680da8e4e5a7e3c4c3a0c (diff) | |
download | perl-e203899dcaadab28f2ff9e515fbc895686054f71.tar.gz |
Fixes to -DPERL_DONT_CREATE_GVSV to make more tests pass
p4raw-id: //depot/perl@25010
-rw-r--r-- | doio.c | 2 | ||||
-rw-r--r-- | gv.c | 2 | ||||
-rw-r--r-- | perl.h | 3 | ||||
-rw-r--r-- | sv.c | 26 |
4 files changed, 19 insertions, 14 deletions
@@ -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)) { @@ -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); @@ -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 */ @@ -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)); |