aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Viro <viro@www.linux.org.uk>2004-08-12 19:22:25 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-07 21:02:45 -0700
commitf8034e0d13215c25bf04660535f5d95e4017eb52 (patch)
tree026fb143395e6d8a377ae643d58dbaef1e673d93 /tokenize.c
parent[PATCH] handling of non-lvalue compound objects (diff)
downloadsparse-f8034e0d13215c25bf04660535f5d95e4017eb52.tar.gz
sparse-f8034e0d13215c25bf04660535f5d95e4017eb52.tar.bz2
sparse-f8034e0d13215c25bf04660535f5d95e4017eb52.zip
[PATCH] teach show_special() to handle tokens introduced by evaluate_comparison()
Fix handling of replaced comparisons in expression. We are handling unsigned comparisons by replacing the expr->op with new special values (SPECIAL_UNSIGNED_{LT,GT,LTE,GTE}) which works fine, but confuses the hell out of show_special(). As the result, test-linearize simply segfaults on any code that contains unsigned comparison. This patch fixes that by teaching show_special() to handle these guys and making sure that tokenizer doesn't get confused (it uses the same set of strings to recognize punctuators). Signed-off-by: Al Viro <viro@parcelfarce.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'tokenize.c')
-rw-r--r--tokenize.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tokenize.c b/tokenize.c
index d98a32a..373aeb1 100644
--- a/tokenize.c
+++ b/tokenize.c
@@ -607,7 +607,7 @@ static int drop_stream_comment(stream_t *stream)
unsigned char combinations[][3] = COMBINATION_STRINGS;
-#define NR_COMBINATIONS (sizeof(combinations)/3)
+#define NR_COMBINATIONS (SPECIAL_ARG_SEPARATOR - SPECIAL_BASE)
static int get_one_special(int c, stream_t *stream)
{