aboutsummaryrefslogtreecommitdiff
path: root/gcc/rtl.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@cygnus.com>1998-04-10 13:41:28 +0000
committerNick Clifton <nickc@gcc.gnu.org>1998-04-10 13:41:28 +0000
commit29cb1e1f173b2e9c4ee6aff74731401a10fae5a7 (patch)
tree8032f473eb00af80a8c6057c95965809a84e9647 /gcc/rtl.c
parent3f51802074c07f2471a46128d0ccf404eb48ecf7 (diff)
downloadgcc-29cb1e1f173b2e9c4ee6aff74731401a10fae5a7.zip
gcc-29cb1e1f173b2e9c4ee6aff74731401a10fae5a7.tar.gz
gcc-29cb1e1f173b2e9c4ee6aff74731401a10fae5a7.tar.bz2
Prevent going into an infinite loop upon encountering an enuterminated comment.
From-SVN: r19082
Diffstat (limited to 'gcc/rtl.c')
-rw-r--r--gcc/rtl.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/rtl.c b/gcc/rtl.c
index 4bed8c7..e7f6cae 100644
--- a/gcc/rtl.c
+++ b/gcc/rtl.c
@@ -496,7 +496,8 @@ read_skip_spaces (infile)
;
else if (c == ';')
{
- while ((c = getc (infile)) && c != '\n') ;
+ while ((c = getc (infile)) && c != '\n' && c != EOF)
+ ;
}
else if (c == '/')
{
@@ -506,7 +507,7 @@ read_skip_spaces (infile)
dump_and_abort ('*', c, infile);
prevc = 0;
- while ((c = getc (infile)))
+ while ((c = getc (infile)) && c != EOF)
{
if (prevc == '*' && c == '/')
break;