summaryrefslogtreecommitdiff
path: root/gv.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2006-03-05 11:53:55 +0000
committerNicholas Clark <nick@ccl4.org>2006-03-05 11:53:55 +0000
commitf5c1e8072077f841044d944ef64ecf3a45cff725 (patch)
tree25d51fe0be0774c7e2db4cdebac16e094bb09487 /gv.c
parent49a7a762557426d9605bb476108c1375454ae233 (diff)
downloadperl-f5c1e8072077f841044d944ef64ecf3a45cff725.tar.gz
Provide Perl_gv_name_set to replace LVALUE use of GvNAME and GvNAMESET.
p4raw-id: //depot/perl@27377
Diffstat (limited to 'gv.c')
-rw-r--r--gv.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/gv.c b/gv.c
index 00fed57a86..f6c2087ce6 100644
--- a/gv.c
+++ b/gv.c
@@ -215,8 +215,7 @@ Perl_gv_init(pTHX_ GV *gv, HV *stash, const char *name, STRLEN len, int multi)
GvSTASH(gv) = stash;
if (stash)
Perl_sv_add_backref(aTHX_ (SV*)stash, (SV*)gv);
- GvNAME(gv) = savepvn(name, len);
- GvNAMELEN(gv) = len;
+ gv_name_set(gv, name, len, 0);
if (multi || doproto) /* doproto means it _was_ mentioned */
GvMULTI_on(gv);
if (doproto) { /* Replicate part of newSUB here. */
@@ -2104,6 +2103,17 @@ Perl_is_gv_magical(pTHX_ const char *name, STRLEN len, U32 flags)
return FALSE;
}
+void
+Perl_gv_name_set(pTHX_ GV *gv, const char *name, U32 len, U32 flags)
+{
+ dVAR;
+
+ PERL_UNUSED_ARG(flags);
+
+ GvXPVGV(gv)->xgv_name = name ? savepvn(name, len) : NULL;
+ GvXPVGV(gv)->xgv_namelen = len;
+}
+
/*
* Local variables:
* c-indentation-style: bsd