From eb3f1826060357e42bee29b4e310364a90c4b582 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Fri, 23 Nov 2012 09:35:32 +0300 Subject: [PATCH] conditions: preserve the type in select assignments The original code made everything long long one or long long zero. Signed-off-by: Dan Carpenter --- smatch_conditions.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/smatch_conditions.c b/smatch_conditions.c index 5ea8da4b..45307a26 100644 --- a/smatch_conditions.c +++ b/smatch_conditions.c @@ -471,7 +471,9 @@ int __handle_condition_assigns(struct expression *expr) on the big_expression_stack. */ push_expression(&big_expression_stack, right); split_conditions(right); - set_true_false_states_expr(SMATCH_EXTRA, expr->left, alloc_estate(ll_to_sval(1)), alloc_estate(ll_to_sval(0))); + set_true_false_states_expr(SMATCH_EXTRA, expr->left, + alloc_estate(sval_type_val(get_type(expr->left), 1)), + alloc_estate(sval_type_val(get_type(expr->left), 0))); __use_cond_states(); __pass_to_client(right, WHOLE_CONDITION_HOOK); pop_expression(&big_expression_stack); -- 2.11.4.GIT