diff options
author | Nicholas Clark <nick@ccl4.org> | 2005-06-02 14:42:20 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2005-06-02 14:42:20 +0000 |
commit | 4b6dd97a16e9a5ba7782d6c0bdac29cff4a29dc4 (patch) | |
tree | b0a0895321bbdac4ccd17838b08ef86c55bf891a /toke.c | |
parent | 7a9b70e91d2c0aa19f8cec5b0f8c133492a19280 (diff) | |
download | perl-4b6dd97a16e9a5ba7782d6c0bdac29cff4a29dc4.tar.gz |
24672 is innocent. valgrind + perl's malloc considered harmful.
p4raw-id: //depot/perl@24677
Diffstat (limited to 'toke.c')
-rw-r--r-- | toke.c | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -5538,8 +5538,11 @@ S_pending_ident(pTHX) /* might be an "our" variable" */ if (PAD_COMPNAME_FLAGS(tmp) & SVpad_OUR) { /* build ops for a bareword */ - SV *sym = newSVpvn(HvNAME_get(PAD_COMPNAME_OURSTASH(tmp)), - HvNAMELEN_get(PAD_COMPNAME_OURSTASH(tmp))); + HV *stash = PAD_COMPNAME_OURSTASH(tmp); + HEK *stashname = HvNAME_HEK(stash); + SV *sym = stashname + ? newSVpvn(HEK_KEY(stashname), HEK_LEN(stashname)) + : newSVpvn(0, 0); sv_catpvn(sym, "::", 2); sv_catpv(sym, PL_tokenbuf+1); yylval.opval = (OP*)newSVOP(OP_CONST, 0, sym); @@ -9739,9 +9742,12 @@ S_scan_inputsymbol(pTHX_ char *start) */ if ((tmp = pad_findmy(d)) != NOT_IN_PAD) { if (PAD_COMPNAME_FLAGS(tmp) & SVpad_OUR) { - SV *sym = sv_2mortal( - newSVpvn(HvNAME_get(PAD_COMPNAME_OURSTASH(tmp)), - HvNAMELEN_get(PAD_COMPNAME_OURSTASH(tmp)))); + HV *stash = PAD_COMPNAME_OURSTASH(tmp); + HEK *stashname = HvNAME_HEK(stash); + SV *sym = sv_2mortal(stashname + ? newSVpvn(HEK_KEY(stashname), + HEK_LEN(stashname)) + : newSVpvn(0, 0)); sv_catpvn(sym, "::", 2); sv_catpv(sym, d+1); d = SvPVX(sym); |