From 95560547275b7bf16b092c08e55e3a54c4a3e88e Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Mon, 19 Nov 2012 17:35:46 +0300 Subject: [PATCH] sval: type: hack select types We really don't know the type here, but it's probably ok to guess. If we don't then the caller is just going to use &llong_ctype anyway. Signed-off-by: Dan Carpenter --- smatch_type.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/smatch_type.c b/smatch_type.c index 020129a8..3cc6d67a 100644 --- a/smatch_type.c +++ b/smatch_type.c @@ -147,9 +147,14 @@ static struct symbol *get_select_type(struct expression *expr) two = get_type(expr->cond_false); if (!one || !two) return NULL; - if (types_equiv(one, two)) + /* + * This is a hack. If the types are not equiv then we + * really don't know the type. But I think guessing is + * probably Ok here. + */ + if (type_positive_bits(one) > type_positive_bits(two)) return one; - return NULL; + return two; } struct symbol *get_pointer_type(struct expression *expr) -- 2.11.4.GIT