aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2003-06-23 13:57:39 +0000
committerNick Clifton <nickc@gcc.gnu.org>2003-06-23 13:57:39 +0000
commita3c18e4f6510be9263028126b63c6f31727c47da (patch)
tree2cbb21eea43e284bfaba02174801a19d400ab2ad
parent4319ef2a9d871c47640067f4f477d87be4faa0e1 (diff)
downloadgcc-a3c18e4f6510be9263028126b63c6f31727c47da.zip
gcc-a3c18e4f6510be9263028126b63c6f31727c47da.tar.gz
gcc-a3c18e4f6510be9263028126b63c6f31727c47da.tar.bz2
(read_braced_string): Check for EOF. If encountered issue an error message.
From-SVN: r68363
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/read-rtl.c6
2 files changed, 11 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e8006e4..583050e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+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>
* doc/invoke.texi: Document dump options, dT and dW.
diff --git a/gcc/read-rtl.c b/gcc/read-rtl.c
index fd17bd0..9d08da4 100644
--- a/gcc/read-rtl.c
+++ b/gcc/read-rtl.c
@@ -298,11 +298,13 @@ read_braced_string (ob, infile)
{
int c;
int brace_depth = 1; /* caller-processed */
+ unsigned long starting_read_rtx_lineno = read_rtx_lineno;
obstack_1grow (ob, '{');
while (brace_depth)
{
c = getc (infile); /* Read the string */
+
if (c == '\n')
read_rtx_lineno++;
else if (c == '{')
@@ -314,6 +316,10 @@ read_braced_string (ob, infile)
read_escape (ob, infile);
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);
}