aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-lex.c
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1994-04-18 15:25:32 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1994-04-18 15:25:32 -0400
commita47a0ed53b1068e5100befb6bb6b7d5af211a382 (patch)
treef8fb9b4a3aed4311f41914b21a118c7b381e6edb /gcc/c-lex.c
parent28612f9eb6f0aa1a5e441a1c42bc261a08c3d7e2 (diff)
downloadgcc-a47a0ed53b1068e5100befb6bb6b7d5af211a382.zip
gcc-a47a0ed53b1068e5100befb6bb6b7d5af211a382.tar.gz
gcc-a47a0ed53b1068e5100befb6bb6b7d5af211a382.tar.bz2
(yylex): If FP value is NaN, use value of zero.
From-SVN: r7071
Diffstat (limited to 'gcc/c-lex.c')
-rw-r--r--gcc/c-lex.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/c-lex.c b/gcc/c-lex.c
index 997e9a0..ad34e60 100644
--- a/gcc/c-lex.c
+++ b/gcc/c-lex.c
@@ -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),