From: Greg McGary Date: Fri, 15 Sep 2000 21:25:02 +0000 (+0000) Subject: cppmacro.c (check_trad_stringification): Check token text pointers against limit... X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=61c16b103833aa487ddba5eed50a1a4278212a75;p=platform%2Fupstream%2Fgcc.git cppmacro.c (check_trad_stringification): Check token text pointers against limit before dereferencing. * cppmacro.c (check_trad_stringification): Check token text pointers against limit before dereferencing. From-SVN: r36447 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bda64dc..1810deb 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2000-09-15 Greg McGary + + * cppmacro.c (check_trad_stringification): Check token + text pointers against limit before dereferencing. + 2000-09-15 Joseph S. Myers * c-common.c (format_wanted_type): New structure. diff --git a/gcc/cppmacro.c b/gcc/cppmacro.c index 2b16fd47..82dfd7f 100644 --- a/gcc/cppmacro.c +++ b/gcc/cppmacro.c @@ -645,11 +645,13 @@ check_trad_stringification (pfile, info, string) const cpp_token *token; /* Find the start of an identifier. */ - while (!is_idstart (*p) && p < limit) p++; + while (p < limit && !is_idstart (*p)) + p++; /* Find the end of the identifier. */ q = p; - while (is_idchar (*q) && q < limit) q++; + while (q < limit && is_idchar (*q)) + q++; /* Loop over the function macro arguments to see if the identifier inside the string matches one of them. */