aboutsummaryrefslogtreecommitdiff
path: root/gcc/cppmacro.c
diff options
context:
space:
mode:
authorGreg McGary <greg@mcgary.org>2000-09-15 21:25:02 +0000
committerGreg McGary <gkm@gcc.gnu.org>2000-09-15 21:25:02 +0000
commit61c16b103833aa487ddba5eed50a1a4278212a75 (patch)
treeef564e7fbae03288e99c3b241a19bc54a606ff40 /gcc/cppmacro.c
parent6a357625bd4bdc4129446c2df296a9808e3e9812 (diff)
downloadgcc-61c16b103833aa487ddba5eed50a1a4278212a75.zip
gcc-61c16b103833aa487ddba5eed50a1a4278212a75.tar.gz
gcc-61c16b103833aa487ddba5eed50a1a4278212a75.tar.bz2
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
Diffstat (limited to 'gcc/cppmacro.c')
-rw-r--r--gcc/cppmacro.c6
1 files changed, 4 insertions, 2 deletions
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. */