From: Nicholas Clark Date: Sat, 9 Dec 2006 21:19:45 +0000 (+0000) Subject: PVBMs mustn't enter anything that turns SVIVisUV_on(). X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=50caf62e77809dea76eee38c00ffaa08a0153def;p=p5sagit%2Fp5-mst-13.2.git PVBMs mustn't enter anything that turns SVIVisUV_on(). p4raw-id: //depot/perl@29494 --- diff --git a/sv.c b/sv.c index e4deb9d..cd186e4 100644 --- a/sv.c +++ b/sv.c @@ -2159,7 +2159,11 @@ Perl_sv_2iv_flags(pTHX_ register SV *sv, I32 flags) dVAR; if (!sv) return 0; - if (SvGMAGICAL(sv)) { + if (SvGMAGICAL(sv) || SvTYPE(sv) == SVt_PVBM) { + /* PVBMs use the same flag bit as SVf_IVisUV, so must let them + cache IVs just in case. In practice it seems that they never + actually anywhere accessible by user Perl code, let alone get used + in anything other than a string context. */ if (flags & SV_GMAGIC) mg_get(sv); if (SvIOKp(sv)) @@ -2239,7 +2243,9 @@ Perl_sv_2uv_flags(pTHX_ register SV *sv, I32 flags) dVAR; if (!sv) return 0; - if (SvGMAGICAL(sv)) { + if (SvGMAGICAL(sv) || SvTYPE(sv) == SVt_PVBM) { + /* PVBMs use the same flag bit as SVf_IVisUV, so must let them + cache IVs just in case. */ if (flags & SV_GMAGIC) mg_get(sv); if (SvIOKp(sv)) @@ -2314,7 +2320,9 @@ Perl_sv_2nv(pTHX_ register SV *sv) dVAR; if (!sv) return 0.0; - if (SvGMAGICAL(sv)) { + if (SvGMAGICAL(sv) || SvTYPE(sv) == SVt_PVBM) { + /* PVBMs use the same flag bit as SVf_IVisUV, so must let them + cache IVs just in case. */ mg_get(sv); if (SvNOKp(sv)) return SvNVX(sv);