Prevent going into an infinite loop upon encountering an enuterminated comment.
authorNick Clifton <nickc@cygnus.com>
Fri, 10 Apr 1998 13:41:28 +0000 (13:41 +0000)
committerNick Clifton <nickc@gcc.gnu.org>
Fri, 10 Apr 1998 13:41:28 +0000 (13:41 +0000)
From-SVN: r19082

gcc/ChangeLog
gcc/rtl.c

index b12483aff56c510bf4c29fa798c773d17aee1a53..13142840db719c568064ad8253fd1e5f49a3a754 100644 (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
index 4bed8c7221e36ecea7469feb2124ee6f53a0789f..e7f6cae70ae21e53fbc1776f38484ef87d4bccee 100644 (file)
--- 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;