]> granicus.if.org Git - php/commitdiff
Fixed Bug #25665 (var_dump() hangs on Nan and INF).
authorIlia Alshanetsky <iliaa@php.net>
Mon, 29 Sep 2003 01:07:55 +0000 (01:07 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Mon, 29 Sep 2003 01:07:55 +0000 (01:07 +0000)
main/spprintf.c

index 104a2a58f66db048e20b2d224eaa1ad8f8685d6d..182918bbcf0a79ca39acaebd3e087469e733f1c2 100644 (file)
@@ -569,6 +569,22 @@ static void xbuf_format_converter(smart_str *xbuf, const char *fmt, va_list ap)
                                                default:
                                                        goto fmt_error;
                                        }
+
+                                       if (zend_isnan(fp_num)) {
+                                               s = "NAN";
+                                               s_len = 3;
+                                               break;
+                                       } else if (zend_isinf(fp_num)) {
+                                               if (fp_num > 0) {
+                                                       s = "INF";
+                                                       s_len = 3;
+                                               } else {
+                                                       s = "-INF";
+                                                       s_len = 4;
+                                               }
+                                               break;
+                                       }
+
                                        if (adjust_precision == NO)
                                                precision = FLOAT_DIGITS;
                                        else if (precision == 0)