From 7296c6e565e196da19fda31a08d5018338149f67 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Thu, 23 May 2013 11:21:17 +0300 Subject: [PATCH] local_values: store correct initial value The cur_symbol was stored to the new variable that we hadn't processed yet so we ended up getting the incorrect initial value. Signed-off-by: Dan Carpenter --- smatch_local_values.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/smatch_local_values.c b/smatch_local_values.c index 8f8e2d28..19448787 100644 --- a/smatch_local_values.c +++ b/smatch_local_values.c @@ -179,13 +179,13 @@ static int save_final_values(void *unused, int argc, char **argv, char **azColNa char *value = argv[2]; struct range_list *rl; - cur_symbol = (struct symbol *)strtoul(sym_str, NULL, 10); - - if (!cur_name) + if (!cur_name) { cur_name = alloc_string(name); - else if (strcmp(cur_name, name) != 0) { + cur_symbol = (struct symbol *)strtoul(sym_str, NULL, 10); + } else if (strcmp(cur_name, name) != 0) { add_current_local(); cur_name = alloc_string(name); + cur_symbol = (struct symbol *)strtoul(sym_str, NULL, 10); cur_rl = NULL; } -- 2.11.4.GIT