From 71a1e17828b81ac3b81df0e8b8efe95990b8c271 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Mon, 15 Apr 2013 11:37:59 +0300 Subject: [PATCH] conditions: use set_extra_expr_mod() to change extra states The problem here is that we're always supposed to use helper functions to set extra states. Especially if we're changing the states because a variable was modified because we have to call some call backs for that. Signed-off-by: Dan Carpenter --- smatch_conditions.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/smatch_conditions.c b/smatch_conditions.c index 9450d3dd..fbe5ac14 100644 --- a/smatch_conditions.c +++ b/smatch_conditions.c @@ -473,10 +473,8 @@ 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_sval(sval_type_val(get_type(expr->left), 1)), - alloc_estate_sval(sval_type_val(get_type(expr->left), 0))); __use_cond_states(); + set_extra_expr_mod(expr->left, alloc_estate_sval(sval_type_val(get_type(expr->left), 1))); __pass_to_client(right, WHOLE_CONDITION_HOOK); pop_expression(&big_expression_stack); inside_condition--; @@ -484,6 +482,7 @@ int __handle_condition_assigns(struct expression *expr) __push_true_states(); __use_false_states(); + set_extra_expr_mod(expr->left, alloc_estate_sval(sval_type_val(get_type(expr->left), 0))); __merge_true_states(); __pass_to_client(expr, ASSIGNMENT_HOOK); return 1; -- 2.11.4.GIT