diff options
author | Father Chrysostomos <sprout@cpan.org> | 2012-01-31 20:40:14 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2012-01-31 20:40:14 -0800 |
commit | c3ec315fadce0718efe754f1728a276abd110e9a (patch) | |
tree | 8b59a3b549cd24c87e0bb34b2e066708ac323bc7 /sv.c | |
parent | 5e51a18cb1805eccb33d3696b2fac9fd3cfbf6b0 (diff) | |
download | perl-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.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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); } |