This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Re: overload64.t failures
authorRick Delaney <rick@consumercontact.com>
Sun, 21 Oct 2007 16:13:51 +0000 (12:13 -0400)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Sun, 21 Oct 2007 20:19:08 +0000 (20:19 +0000)
Message-ID: <20071021201351.GY29047@bort.ca>

p4raw-id: //depot/perl@32157

pp.c
pp_hot.c

diff --git a/pp.c b/pp.c
index cd04198..6d69589 100644 (file)
--- a/pp.c
+++ b/pp.c
@@ -1040,7 +1040,9 @@ PP(pp_pow)
   float_it:
 #endif    
     {
-       dPOPTOPnnrl;
+       NV right = SvNV(svr);
+       NV left  = SvNV(svl);
+       (void)POPs;
 
 #if defined(USE_LONG_DOUBLE) && defined(HAS_AIX_POWL_NEG_BASE_BUG)
     /*
@@ -1206,7 +1208,9 @@ PP(pp_multiply)
     } /* SvIOK(svr) */
 #endif
     {
-      dPOPTOPnnrl;
+      NV right = SvNV(svr);
+      NV left  = SvNV(svl);
+      (void)POPs;
       SETn( left * right );
       RETURN;
     }
@@ -1322,7 +1326,9 @@ PP(pp_divide)
     } /* right wasn't SvIOK */
 #endif /* PERL_TRY_UV_DIVIDE */
     {
-       dPOPPOPnnrl;
+       NV right = SvNV(svr);
+       NV left  = SvNV(svl);
+       (void)POPs;(void)POPs;
 #if defined(NAN_COMPARE_BROKEN) && defined(Perl_isnan)
        if (! Perl_isnan(right) && right == 0.0)
 #else
@@ -1362,10 +1368,9 @@ PP(pp_modulo)
                     right = -biv;
                 }
             }
-            sp--;
         }
         else {
-           dright = POPn;
+           dright = SvNV(svr);
            right_neg = dright < 0;
            if (right_neg)
                dright = -dright;
@@ -1376,6 +1381,7 @@ PP(pp_modulo)
                 use_double = TRUE;
             }
        }
+       sp--;
 
         /* At this point use_double is only true if right is out of range for
            a UV.  In range NV has been rounded down to nearest UV and
@@ -1396,11 +1402,10 @@ PP(pp_modulo)
                         left = -aiv;
                     }
                 }
-                sp--;
             }
         }
        else {
-           dleft = POPn;
+           dleft = SvNV(svl);
            left_neg = dleft < 0;
            if (left_neg)
                dleft = -dleft;
@@ -1428,6 +1433,7 @@ PP(pp_modulo)
                 }
             }
         }
+       sp--;
        if (use_double) {
            NV dans;
 
@@ -1699,13 +1705,15 @@ PP(pp_subtract)
     }
 #endif
     {
-       dPOPnv;
+       NV value = SvNV(svr);
+       (void)POPs;
+
        if (!useleft) {
            /* left operand is undef, treat as zero - value */
            SETn(-value);
            RETURN;
        }
-       SETn( TOPn - value );
+       SETn( SvNV(svl) - value );
        RETURN;
     }
 }
index 17eb6f2..57fa328 100644 (file)
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -648,13 +648,14 @@ PP(pp_add)
     }
 #endif
     {
-       dPOPnv;
+       NV value = SvNV(svr);
+       (void)POPs;
        if (!useleft) {
            /* left operand is undef, treat as zero. + 0.0 is identity. */
            SETn(value);
            RETURN;
        }
-       SETn( value + TOPn );
+       SETn( value + SvNV(svl) );
        RETURN;
     }
 }