Commit a3c18e4f by Nick Clifton Committed by Nick Clifton

(read_braced_string): Check for EOF. If encountered issue an error message.

From-SVN: r68363
parent 4319ef2a
2003-06-23 Nick Clifton <nickc@redhat.com>
* read-rtl.c (read_braced_string): Check for EOF. If
encountered issue an error message.
2003-06-23 Kazu Hirata <kazu@cs.umass.edu> 2003-06-23 Kazu Hirata <kazu@cs.umass.edu>
* doc/invoke.texi: Document dump options, dT and dW. * doc/invoke.texi: Document dump options, dT and dW.
......
...@@ -298,11 +298,13 @@ read_braced_string (ob, infile) ...@@ -298,11 +298,13 @@ read_braced_string (ob, infile)
{ {
int c; int c;
int brace_depth = 1; /* caller-processed */ int brace_depth = 1; /* caller-processed */
unsigned long starting_read_rtx_lineno = read_rtx_lineno;
obstack_1grow (ob, '{'); obstack_1grow (ob, '{');
while (brace_depth) while (brace_depth)
{ {
c = getc (infile); /* Read the string */ c = getc (infile); /* Read the string */
if (c == '\n') if (c == '\n')
read_rtx_lineno++; read_rtx_lineno++;
else if (c == '{') else if (c == '{')
...@@ -314,6 +316,10 @@ read_braced_string (ob, infile) ...@@ -314,6 +316,10 @@ read_braced_string (ob, infile)
read_escape (ob, infile); read_escape (ob, infile);
continue; continue;
} }
else if (c == EOF)
fatal_with_file_and_line
(infile, "missing closing } for opening brace on line %lu",
starting_read_rtx_lineno);
obstack_1grow (ob, c); obstack_1grow (ob, c);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment