From bdc351492fad255ecad20a4f4bca2eb9244d93a3 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Mon, 8 May 2023 21:33:56 +0300 Subject: [PATCH] conditions: strip stuff off a STMT_EXPRESSION This also strips away a bunch of builtin functions so it's more important than just stripping the parens. Signed-off-by: Dan Carpenter --- smatch_conditions.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/smatch_conditions.c b/smatch_conditions.c index 9d5985ea..db0a9341 100644 --- a/smatch_conditions.c +++ b/smatch_conditions.c @@ -798,7 +798,8 @@ int __handle_expr_statement_assigns(struct expression *expr) } else if (stmt->type == STMT_EXPRESSION) { struct expression *fake_assign; - fake_assign = assign_expression(expr->left, expr->op, stmt->expression); + right = strip_no_cast(stmt->expression); + fake_assign = assign_expression(expr->left, expr->op, right); expr_set_parent_expr(fake_assign, expr); __split_expr(fake_assign); -- 2.11.4.GIT