From a47a0ed53b1068e5100befb6bb6b7d5af211a382 Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Mon, 18 Apr 1994 15:25:32 -0400 Subject: [PATCH] (yylex): If FP value is NaN, use value of zero. From-SVN: r7071 --- gcc/c-lex.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gcc/c-lex.c b/gcc/c-lex.c index 997e9a0fcdc1..ad34e601327b 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), -- 2.47.2