summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-01-31 20:40:14 -0800
committerFather Chrysostomos <sprout@cpan.org>2012-01-31 20:40:14 -0800
commitc3ec315fadce0718efe754f1728a276abd110e9a (patch)
tree8b59a3b549cd24c87e0bb34b2e066708ac323bc7 /sv.c
parent5e51a18cb1805eccb33d3696b2fac9fd3cfbf6b0 (diff)
downloadperl-c3ec315fadce0718efe754f1728a276abd110e9a.tar.gz
Stop SvPVutf8 from forcing the POK flag
It was setting this even on magical variables, causing stringification not to bother calling FETCH, because the POK flag means ‘yes, I’m a bonified [sic] string, with nothing funny going on’.
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sv.c b/sv.c
index f53ad12139..03c1874a8c 100644
--- a/sv.c
+++ b/sv.c
@@ -3062,7 +3062,9 @@ Perl_sv_2pvutf8(pTHX_ register SV *sv, STRLEN *const lp)
if ((SvTHINKFIRST(sv) && !SvIsCOW(sv)) || isGV_with_GP(sv))
sv = sv_mortalcopy(sv);
sv_utf8_upgrade(sv);
- return lp ? SvPV(sv,*lp) : SvPV_nolen(sv);
+ if (SvGMAGICAL(sv)) SvFLAGS(sv) &= ~SVf_POK;
+ assert(SvPOKp(sv));
+ return lp ? SvPV_nomg(sv,*lp) : SvPV_nomg_nolen(sv);
}