aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorDave Brolley <brolley@cygnus.com>1998-07-27 12:37:16 +0000
committerDave Brolley <brolley@gcc.gnu.org>1998-07-27 08:37:16 -0400
commitea6c1142846219717fa78ee9f030b841e7f4b52b (patch)
treef4c89445d52b7f99065872aa75b0cf6717cb486b /gcc
parent84530511d2506d48804420cae40495950199ff0e (diff)
downloadgcc-ea6c1142846219717fa78ee9f030b841e7f4b52b.zip
gcc-ea6c1142846219717fa78ee9f030b841e7f4b52b.tar.gz
gcc-ea6c1142846219717fa78ee9f030b841e7f4b52b.tar.bz2
c-lex.c (yylex): Fix boundary conditions in character literal and string literal loops.
1998-07-27 Dave Brolley <brolley@cygnus.com> * c-lex.c (yylex): Fix boundary conditions in character literal and string literal loops. From-SVN: r21412
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/lex.c10
2 files changed, 10 insertions, 5 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index c44d18a..d707577 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+1998-07-27 Dave Brolley <brolley@cygnus.com>
+
+ * c-lex.c (yylex): Fix boundary conditions in character literal and
+ string literal loops.
+
1998-07-24 Jason Merrill <jason@yorick.cygnus.com>
* decl.c (lookup_name_real): OK, do return the from_obj value
diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c
index 5ef7f1d..d127ddc 100644
--- a/gcc/cp/lex.c
+++ b/gcc/cp/lex.c
@@ -4132,7 +4132,7 @@ real_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;
@@ -4169,7 +4169,7 @@ real_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)
@@ -4188,7 +4188,7 @@ real_yylex ()
}
else
{
- if (p == token_buffer + maxtoken)
+ if (p >= token_buffer + maxtoken)
p = extend_token_buffer (p);
*p++ = c;
}
@@ -4205,14 +4205,14 @@ real_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;
}