This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Actually fix GH #17370
authorKarl Williamson <khw@cpan.org>
Tue, 17 Dec 2019 21:59:29 +0000 (14:59 -0700)
committerKarl Williamson <khw@cpan.org>
Tue, 17 Dec 2019 22:03:21 +0000 (15:03 -0700)
I only added a test, but not the change in
9f16475a53933d1d9c547f871b97b3b12160cece.  The test passes except when
run under address sanitizer or valgrind.

numeric.c

index 142f617..0b8677d 100644 (file)
--- a/numeric.c
+++ b/numeric.c
@@ -780,6 +780,9 @@ Perl_grok_infnan(pTHX_ const char** sp, const char* send)
             s++;
 
             flags |= IS_NUMBER_NAN | IS_NUMBER_NOT_INT;
+            if (s == send) {
+                return flags;
+            }
 
             /* NaN can be followed by various stuff (NaNQ, NaNS), but
              * there are also multiple different NaN values, and some