From b8185320376b621b8a7656e2349ac9bee23f8e9c Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Thu, 20 Sep 2018 14:10:03 +0300 Subject: [PATCH] sval: handle casting to bool sval_cast() didn't handle bool types. Signed-off-by: Dan Carpenter --- smatch_sval.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/smatch_sval.c b/smatch_sval.c index 4bbfbe43..a9eb8a08 100644 --- a/smatch_sval.c +++ b/smatch_sval.c @@ -268,6 +268,9 @@ sval_t sval_cast(struct symbol *type, sval_t sval) ret.type = type; switch (sval_bits(ret)) { + case 1: + ret.value = !!sval.value; + break; case 8: if (sval_unsigned(ret)) ret.value = (long long)(unsigned char)sval.value; -- 2.11.4.GIT