OSDN Git Service

Mon Jul 27 14:22:36 1998 Dave Brolley <brolley@cygnus.com>
authorbrolley <brolley@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 27 Jul 1998 12:51:56 +0000 (12:51 +0000)
committerbrolley <brolley@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 27 Jul 1998 12:51:56 +0000 (12:51 +0000)
* c-lex.c (yylex): Fix boundary conditions in character literal and
string literal loops.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@21413 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/c-lex.c

index a325bad..cf87be4 100644 (file)
@@ -1,3 +1,8 @@
+Mon Jul 27 14:22:36 1998  Dave Brolley  <brolley@cygnus.com>
+
+       * c-lex.c (yylex): Fix boundary conditions in character literal and
+       string literal loops.
+
 Mon Jul 27 11:43:54 1998  Stan Cox  <scox@cygnus.com>
 
        * longlong.h (count_leading_zeros): Sparclite scan instruction was
index f4f4a12..69055f4 100644 (file)
@@ -1994,7 +1994,7 @@ yylex ()
                int char_len = -1;
                for (i = 0; i < longest_char; ++i)
                  {
-                   if (p + i == token_buffer + maxtoken)
+                   if (p + i >= token_buffer + maxtoken)
                      p = extend_token_buffer (p);
                    p[i] = c;
 
@@ -2031,7 +2031,7 @@ yylex ()
                unsigned bytemask = (1 << width) - 1;
                int byte;
 
-               if (p + WCHAR_BYTES >= token_buffer + maxtoken)
+               if (p + WCHAR_BYTES > token_buffer + maxtoken)
                  p = extend_token_buffer (p);
 
                for (byte = 0; byte < WCHAR_BYTES; ++byte)
@@ -2050,7 +2050,7 @@ yylex ()
              }
            else
              {
-               if (p == token_buffer + maxtoken)
+               if (p >= token_buffer + maxtoken)
                  p = extend_token_buffer (p);
                *p++ = c;
              }
@@ -2063,14 +2063,14 @@ yylex ()
           or with a wide zero.  */
        if (wide_flag)
          {
-           if (p + WCHAR_BYTES >= token_buffer + maxtoken)
+           if (p + WCHAR_BYTES > token_buffer + maxtoken)
              p = extend_token_buffer (p);
            bzero (p, WCHAR_BYTES);
            p += WCHAR_BYTES;
          }
        else
          {
-           if (p == token_buffer + maxtoken)
+           if (p >= token_buffer + maxtoken)
              p = extend_token_buffer (p);
            *p++ = 0;
          }