summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2005-06-03 11:06:36 +0000
committerNicholas Clark <nick@ccl4.org>2005-06-03 11:06:36 +0000
commit5aaec2b4ba9ed3b1a9d1569e09bc40d19ec30f8c (patch)
tree96dd815438c6206c6b8c4060abf84e640d6b7060 /toke.c
parentc1b02ed82fa9b8892ce2668d35b6825f1fd3fb59 (diff)
downloadperl-5aaec2b4ba9ed3b1a9d1569e09bc40d19ec30f8c.tar.gz
Use newSVhek where we're generating SVs from package names
p4raw-id: //depot/perl@24697
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/toke.c b/toke.c
index 26b7f3dc68..d09d19143b 100644
--- a/toke.c
+++ b/toke.c
@@ -4346,8 +4346,7 @@ Perl_yylex(pTHX)
case KEY___PACKAGE__:
yylval.opval = (OP*)newSVOP(OP_CONST, 0,
(PL_curstash
- ? newSVpvn(HvNAME_get(PL_curstash),
- HvNAMELEN_get(PL_curstash))
+ ? newSVhek(HvNAME_HEK(PL_curstash))
: &PL_sv_undef));
TERM(THING);
@@ -5540,9 +5539,7 @@ S_pending_ident(pTHX)
/* build ops for a bareword */
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 *sym = newSVhek(stashname);
sv_catpvn(sym, "::", 2);
sv_catpv(sym, PL_tokenbuf+1);
yylval.opval = (OP*)newSVOP(OP_CONST, 0, sym);
@@ -9744,10 +9741,7 @@ S_scan_inputsymbol(pTHX_ char *start)
if (PAD_COMPNAME_FLAGS(tmp) & SVpad_OUR) {
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 *sym = sv_2mortal(newSVhek(stashname));
sv_catpvn(sym, "::", 2);
sv_catpv(sym, d+1);
d = SvPVX(sym);