summaryrefslogtreecommitdiff
path: root/gcc/cpplex.c
diff options
context:
space:
mode:
authorbothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4>2003-08-29 01:07:42 +0000
committerbothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4>2003-08-29 01:07:42 +0000
commit82166c5cf6b2d4c3cff8ceb5581b83017b90e607 (patch)
tree9442b173a19736f0540708f50520b30a3d617823 /gcc/cpplex.c
parent055b0bfa3102b20f555a7b69d0fe3c2e67e80d08 (diff)
downloadgcc-82166c5cf6b2d4c3cff8ceb5581b83017b90e607.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@70898 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cpplex.c')
-rw-r--r--gcc/cpplex.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/cpplex.c b/gcc/cpplex.c
index 1c00bdd0c8e..f779dfb7bc2 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;