summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2009-05-04 18:53:39 +0100
committerNicholas Clark <nick@ccl4.org>2009-05-04 18:53:39 +0100
commit566771cc1208eb7c5c8363435c4bd1299f0ae5e5 (patch)
tree4ce4883dab8dd75b0687434d3d6dd7d4411f50c2 /sv.c
parent1dffc4d1a24556f4e23f612d6713492847ff064b (diff)
downloadperl-566771cc1208eb7c5c8363435c4bd1299f0ae5e5.tar.gz
Make Perl_hek_dup() cope with a NULL "source" parameter (by returning NULL).
Change its callers to take advantage of this.
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sv.c b/sv.c
index b13985b271..9d6fddf0e5 100644
--- a/sv.c
+++ b/sv.c
@@ -10505,7 +10505,7 @@ Perl_gp_dup(pTHX_ GP *const gp, CLONE_PARAMS *const param)
ret->gp_cv = cv_dup_inc(gp->gp_cv, param);
ret->gp_cvgen = gp->gp_cvgen;
ret->gp_line = gp->gp_line;
- ret->gp_file_hek = gp->gp_file_hek ? hek_dup(gp->gp_file_hek, param) : NULL;
+ ret->gp_file_hek = hek_dup(gp->gp_file_hek, param);
return ret;
}
@@ -10954,8 +10954,7 @@ Perl_sv_dup(pTHX_ const SV *const sstr, CLONE_PARAMS *const param)
LvTARG(dstr) = sv_dup_inc(LvTARG(dstr), param);
case SVt_PVGV:
if(isGV_with_GP(sstr)) {
- if (GvNAME_HEK(dstr))
- GvNAME_HEK(dstr) = hek_dup(GvNAME_HEK(dstr), param);
+ GvNAME_HEK(dstr) = hek_dup(GvNAME_HEK(dstr), param);
/* Don't call sv_add_backref here as it's going to be
created as part of the magic cloning of the symbol
table. */
@@ -11053,7 +11052,7 @@ Perl_sv_dup(pTHX_ const SV *const sstr, CLONE_PARAMS *const param)
SvFLAGS(dstr) |= SVf_OOK;
hvname = saux->xhv_name;
- daux->xhv_name = hvname ? hek_dup(hvname, param) : hvname;
+ daux->xhv_name = hek_dup(hvname, param);
daux->xhv_riter = saux->xhv_riter;
daux->xhv_eiter = saux->xhv_eiter