Prevent going into an infinite loop upon encountering an enuterminated comment.

From-SVN: r19082
This commit is contained in:
Nick Clifton 1998-04-10 13:41:28 +00:00 committed by Nick Clifton
parent 3f51802074
commit 29cb1e1f17
2 changed files with 8 additions and 2 deletions

View File

@ -1,3 +1,8 @@
Fri Apr 10 13:40:20 1998 Nick Clifton <nickc@cygnus.com>
* rtl.c (read_skip_spaces): Prevent infinite loops upon
encountering unterminated comments.
Fri Apr 10 10:43:41 1998 Jeffrey A Law (law@cygnus.com)
* emit-rtl.c (operand_subword): Properly handle CONST_INTs for

View File

@ -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;