summaryrefslogtreecommitdiffstats
path: root/contrib/gcclibs/libcpp/lex.c
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2013-12-02 03:47:08 +0000
committerpfg <pfg@FreeBSD.org>2013-12-02 03:47:08 +0000
commitc21473fbdae21f01f569b7f2e9f6f11a68c2cf44 (patch)
tree2e7af369f15283c3155c0cad8aedf0a0986d6e1c /contrib/gcclibs/libcpp/lex.c
parent99b1bb9d11e38921b6a1b89e4b5a3b5c9a5dadd7 (diff)
downloadFreeBSD-src-c21473fbdae21f01f569b7f2e9f6f11a68c2cf44.zip
FreeBSD-src-c21473fbdae21f01f569b7f2e9f6f11a68c2cf44.tar.gz
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
Diffstat (limited to 'contrib/gcclibs/libcpp/lex.c')
-rw-r--r--contrib/gcclibs/libcpp/lex.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/contrib/gcclibs/libcpp/lex.c b/contrib/gcclibs/libcpp/lex.c
index 5d1a688..ef59f900 100644
--- a/contrib/gcclibs/libcpp/lex.c
+++ b/contrib/gcclibs/libcpp/lex.c
@@ -766,6 +766,11 @@ _cpp_lex_token (cpp_reader *pfile)
pfile->cur_run = next_tokenrun (pfile->cur_run);
pfile->cur_token = pfile->cur_run->base;
}
+ /* We assume that the current token is somewhere in the current
+ run. */
+ if (pfile->cur_token < pfile->cur_run->base
+ || pfile->cur_token >= pfile->cur_run->limit)
+ abort ();
if (pfile->lookaheads)
{
@@ -847,11 +852,8 @@ _cpp_get_fresh_line (cpp_reader *pfile)
&& buffer->next_line > buffer->rlimit
&& !buffer->from_stage3)
{
- /* Only warn once. */
+ /* Clip to buffer size. */
buffer->next_line = buffer->rlimit;
- cpp_error_with_line (pfile, CPP_DL_PEDWARN, pfile->line_table->highest_line,
- CPP_BUF_COLUMN (buffer, buffer->cur),
- "no newline at end of file");
}
return_at_eof = buffer->return_at_eof;
OpenPOWER on IntegriCloud