summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2007-01-17 15:42:54 +0000
committerNicholas Clark <nick@ccl4.org>2007-01-17 15:42:54 +0000
commit0d092c369b1b264b1238936288c807173152e270 (patch)
tree043cf7a8924fa28c9509e3f5a17f0036723cf0a8 /sv.c
parentda9330316db1a1f6a74bc9dc4143270e653fc24a (diff)
downloadperl-0d092c369b1b264b1238936288c807173152e270.tar.gz
If we use SvUPGRADE() rather than sv_upgrade() then it can make the
decision on not "up"grading PVLV to PVGV for us. However, it appears that the other actions conducted for "not-yet-a-glob" are useful here. p4raw-id: //depot/perl@29852
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sv.c b/sv.c
index bfc9ee73a6..2d4fc3910a 100644
--- a/sv.c
+++ b/sv.c
@@ -3171,15 +3171,14 @@ S_glob_assign_glob(pTHX_ SV *dstr, SV *sstr, const int dtype)
if (dtype != SVt_PVGV) {
const char * const name = GvNAME(sstr);
const STRLEN len = GvNAMELEN(sstr);
- /* don't upgrade SVt_PVLV: it can hold a glob */
- if (dtype != SVt_PVLV) {
+ {
if (dtype >= SVt_PV) {
SvPV_free(dstr);
SvPV_set(dstr, 0);
SvLEN_set(dstr, 0);
SvCUR_set(dstr, 0);
}
- sv_upgrade(dstr, SVt_PVGV);
+ SvUPGRADE(dstr, SVt_PVGV);
(void)SvOK_off(dstr);
/* FIXME - why are we doing this, then turning it off and on again
below? */