From e2163e3c78c81a00e896b33ea4606a7af01f8f64 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Mon, 19 Nov 2012 21:47:26 +0300 Subject: [PATCH] sval: take the type into consideration when doing an sval_cmp_val(). The original code counted everything as signed. Signed-off-by: Dan Carpenter --- smatch_sval.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/smatch_sval.c b/smatch_sval.c index 054c82bb..61a3e1e8 100644 --- a/smatch_sval.c +++ b/smatch_sval.c @@ -201,11 +201,10 @@ int sval_cmp_t(struct symbol *type, sval_t one, sval_t two) int sval_cmp_val(sval_t one, long long val) { - if (one.value < val) - return -1; - if (one.value == val) - return 0; - return 1; + sval_t sval; + + sval = sval_type_val(&llong_ctype, val); + return sval_cmp(one, sval); } sval_t sval_cast(struct symbol *type, sval_t sval) -- 2.11.4.GIT