Change 29494 by [EMAIL PROTECTED] on 2006/12/09 21:19:45

        PVBMs mustn't enter anything that turns SVIVisUV_on().

Affected files ...

... //depot/perl/sv.c#1332 edit

Differences ...

==== //depot/perl/sv.c#1332 (text) ====
Index: perl/sv.c
--- perl/sv.c#1331~29493~       2006-12-09 13:17:37.000000000 -0800
+++ perl/sv.c   2006-12-09 13:19:45.000000000 -0800
@@ -2159,7 +2159,11 @@
     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 @@
     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 @@
     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);
End of Patch.

Reply via email to