This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Actually fix GH #17370
[perl5.git] / 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