[perl #42614] NAN_COMPARE_BROKEN.DIV_BY_NAN_BUG (with patch)
Patrick Dugnolle [Thu, 19 Apr 2007 06:34:18 +0000 (23:34 -0700)]
From: patrick.dugnolle@bnpparibas.com (via RT) <perlbug-followup@perl.org>
Message-ID: <rt-3.6.HEAD-6655-1176989657-125.42614-75-0@perl.org>

p4raw-id: //depot/perl@30991

pp.c

diff --git a/pp.c b/pp.c
index f532c59..208a1a2 100644 (file)
--- a/pp.c
+++ b/pp.c
@@ -1306,7 +1306,11 @@ PP(pp_divide)
 #endif /* PERL_TRY_UV_DIVIDE */
     {
        dPOPPOPnnrl;
+#if defined(NAN_COMPARE_BROKEN) && defined(Perl_isnan)
+       if (! Perl_isnan(right) && right == 0.0)
+#else
        if (right == 0.0)
+#endif
            DIE(aTHX_ "Illegal division by zero");
        PUSHn( left / right );
        RETURN;