]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
(yylex): If FP value is NaN, use value of zero.
authorRichard Kenner <kenner@gcc.gnu.org>
Mon, 18 Apr 1994 19:25:32 +0000 (15:25 -0400)
committerRichard Kenner <kenner@gcc.gnu.org>
Mon, 18 Apr 1994 19:25:32 +0000 (15:25 -0400)
From-SVN: r7071

gcc/c-lex.c

index 997e9a0fcdc1592ee5912c13161ce5fc25a2acb5..ad34e601327b7c70d2188c65fc940715f0e048f7 100644 (file)
@@ -1407,6 +1407,12 @@ yylex ()
            if (garbage_chars > 0)
              error ("garbage at end of number");
 
+           /* If the result is not a number, assume it must have been
+              due to some error message above, so silently convert
+              it to a zero.  */
+           if (REAL_VALUE_ISNAN (value))
+             value = dconst0;
+
            /* Create a node with determined type and value.  */
            if (imag)
              yylval.ttype = build_complex (convert (type, integer_zero_node),