diff options
author | Per Bothner <per@bothner.com> | 2003-08-28 18:07:42 -0700 |
---|---|---|
committer | Per Bothner <bothner@gcc.gnu.org> | 2003-08-28 18:07:42 -0700 |
commit | 2be570f916a5bfa25b09f4acd44c14f5df662889 (patch) | |
tree | 9442b173a19736f0540708f50520b30a3d617823 /gcc/cpplex.c | |
parent | f1e77d8350a2f1264dea6e31eb3e8278a0598ef6 (diff) | |
download | gcc-2be570f916a5bfa25b09f4acd44c14f5df662889.zip gcc-2be570f916a5bfa25b09f4acd44c14f5df662889.tar.gz gcc-2be570f916a5bfa25b09f4acd44c14f5df662889.tar.bz2 |
Fix (hopefully temporary) for breakage caused by my 08-21 patch.
* cpplex.c (_cpp_get_fresh_line): Check for null buffer.
(_cpp_lex_buffer): Likewise.
* cpptrad.c (_cpp_read_logical_line_trad): Likewise.
From-SVN: r70898
Diffstat (limited to 'gcc/cpplex.c')
-rw-r--r-- | gcc/cpplex.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/cpplex.c b/gcc/cpplex.c index 1c00bdd..f779dfb 100644 --- a/gcc/cpplex.c +++ b/gcc/cpplex.c @@ -694,6 +694,9 @@ _cpp_get_fresh_line (cpp_reader *pfile) { cpp_buffer *buffer = pfile->buffer; + if (buffer == NULL) + return false; + if (!buffer->need_line) return true; @@ -759,7 +762,8 @@ _cpp_lex_direct (cpp_reader *pfile) fresh_line: result->flags = 0; - if (pfile->buffer->need_line) + buffer = pfile->buffer; + if (buffer == NULL || buffer->need_line) { if (!_cpp_get_fresh_line (pfile)) { @@ -781,8 +785,8 @@ _cpp_lex_direct (cpp_reader *pfile) result->flags = BOL; if (pfile->state.parsing_args == 2) result->flags |= PREV_WHITE; + buffer = pfile->buffer; } - buffer = pfile->buffer; update_tokens_line: result->line = pfile->line; |