summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2011-10-29 13:41:13 -0700
committerFather Chrysostomos <sprout@cpan.org>2011-10-29 13:42:07 -0700
commit3e1022372a8200bc4c7354e0f588c7f71584a888 (patch)
tree7473c61666a8fa043cecf7174746fce294375bb0 /pp_ctl.c
parent15d9c083b08647e489d279a1059b4f14a3df187b (diff)
downloadperl-3e1022372a8200bc4c7354e0f588c7f71584a888.tar.gz
Remove some repeated code in pp_regcomp
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index eb748404e6..6405924ef0 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -214,19 +214,11 @@ PP(pp_regcomp)
const char *const p = SvPV(tmpstr, len);
tmpstr = newSVpvn_flags(p, len, SVs_TEMP);
}
- else if (SvAMAGIC(tmpstr)) {
+ else if (SvAMAGIC(tmpstr) || SvGMAGICAL(tmpstr)) {
/* make a copy to avoid extra stringifies */
tmpstr = newSVpvn_flags(t, len, SVs_TEMP | SvUTF8(tmpstr));
}
- /* If it is gmagical, create a mortal copy, but without calling
- get-magic, as we have already done that. */
- if(SvGMAGICAL(tmpstr)) {
- SV *mortalcopy = sv_newmortal();
- sv_setsv_flags(mortalcopy, tmpstr, 0);
- tmpstr = mortalcopy;
- }
-
if (eng)
PM_SETRE(pm, CALLREGCOMP_ENG(eng, tmpstr, pm_flags));
else