Commit 29cb1e1f by Nick Clifton Committed by Nick Clifton

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

From-SVN: r19082
parent 3f518020
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) Fri Apr 10 10:43:41 1998 Jeffrey A Law (law@cygnus.com)
* emit-rtl.c (operand_subword): Properly handle CONST_INTs for * emit-rtl.c (operand_subword): Properly handle CONST_INTs for
......
...@@ -496,7 +496,8 @@ read_skip_spaces (infile) ...@@ -496,7 +496,8 @@ read_skip_spaces (infile)
; ;
else if (c == ';') else if (c == ';')
{ {
while ((c = getc (infile)) && c != '\n') ; while ((c = getc (infile)) && c != '\n' && c != EOF)
;
} }
else if (c == '/') else if (c == '/')
{ {
...@@ -506,7 +507,7 @@ read_skip_spaces (infile) ...@@ -506,7 +507,7 @@ read_skip_spaces (infile)
dump_and_abort ('*', c, infile); dump_and_abort ('*', c, infile);
prevc = 0; prevc = 0;
while ((c = getc (infile))) while ((c = getc (infile)) && c != EOF)
{ {
if (prevc == '*' && c == '/') if (prevc == '*' && c == '/')
break; break;
......
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