From 6dddfc54f29ed9e8563937a54084f288a13eff3e Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Wed, 12 Jun 2013 22:58:31 +0300 Subject: [PATCH] helper: fixes to the last expr_to_var_sym() speedup The patch which introduced the "no_parens" parameter had a test in the wrong place so it printed some unintended parenthesis. Signed-off-by: Dan Carpenter --- smatch_helper.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/smatch_helper.c b/smatch_helper.c index 732ccaae..41a4915d 100644 --- a/smatch_helper.c +++ b/smatch_helper.c @@ -142,8 +142,9 @@ static void __get_variable_from_expr(struct symbol **sym_ptr, char *buf, return; } - if (expr->op == '(' && !no_parens) { - append(buf, "(", len); + if (expr->op == '(') { + if (!no_parens) + append(buf, "(", len); } else if (expr->op != '*' || !get_array_expr(expr->unop)) { tmp = show_special(expr->op); append(buf, tmp, len); -- 2.11.4.GIT