From c21473fbdae21f01f569b7f2e9f6f11a68c2cf44 Mon Sep 17 00:00:00 2001 From: pfg Date: Mon, 2 Dec 2013 03:47:08 +0000 Subject: libcpp: Merge fixes from upstream GCC preprocessor/29966: * macro.c (lex_expansion_token): Save and restore cpp_reader's cur_token. (_cpp_create_definition): Don't restore cur_token here. * lex.c (_cpp_lex_token): Added assertion. GCC preprocessor/28709: * macro.c (paste_tokens): Remove PASTE_LEFT from the old lhs. GCC c/31924 * expr.c (interpret_float_suffix): Check for invalid suffix. GCC preprocessor/14331 * lex.c (_cpp_get_fresh_line): Don't warn if no newline at EOF. Fixup whitespacing Obtained from: gcc per-4.3 (rev. 121340, 124356, 124358, 124730, 125212, 125255 ; GPLv2) MFC after: 3 weeks --- contrib/gcclibs/libcpp/expr.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'contrib/gcclibs/libcpp/expr.c') diff --git a/contrib/gcclibs/libcpp/expr.c b/contrib/gcclibs/libcpp/expr.c index 24fcb1b8..ac7252f 100644 --- a/contrib/gcclibs/libcpp/expr.c +++ b/contrib/gcclibs/libcpp/expr.c @@ -87,16 +87,19 @@ interpret_float_suffix (const uchar *s, size_t len) while (len--) switch (s[len]) { - case 'f': case 'F': f++; break; - case 'l': case 'L': l++; break; - case 'i': case 'I': - case 'j': case 'J': i++; break; - case 'd': case 'D': - /* Disallow fd, ld suffixes. */ - if (d && (f || l)) + case 'f': case 'F': + if (d > 0) + return 0; + f++; + break; + case 'l': case 'L': + if (d > 0) return 0; - d++; + l++; break; + case 'i': case 'I': + case 'j': case 'J': i++; break; + case 'd': case 'D': d++; break; default: return 0; } @@ -494,7 +497,7 @@ append_digit (cpp_num num, int digit, int base, size_t precision) if (add_low + digit < add_low) add_high++; add_low += digit; - + if (result.low + add_low < result.low) add_high++; if (result.high + add_high < result.high) @@ -1580,7 +1583,8 @@ num_div_op (cpp_reader *pfile, cpp_num lhs, cpp_num rhs, enum cpp_ttype op) { if (negate) result = num_negate (result, precision); - result.overflow = num_positive (result, precision) ^ !negate; + result.overflow = (num_positive (result, precision) ^ !negate + && !num_zerop (result)); } return result; -- cgit v1.1