From 9912b08b80dc6e225ebb39471a323bddee171fba Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Mon, 25 Jun 2018 11:30:19 +0300 Subject: [PATCH] db: rename call_implies to return_implies I have caller_info and return_states which are the states going into and out of functions. The call_implies table is sort of like return_states but it applies to every path... Mostly it's used for parsing the returned states to say that "this parameter foo->bar->baz was used" or "we dereferenced that parameter". So really it should be called return_implies instead of call_implies. I have sort of started to add some call_implies states to the return_implies table (although maybe none of that work was published) but it's the wrong thing to mix the two different sorts of states. So now I'm going to introduce a new call_implies table and rename the old one to return_implies. I've created the new call_implies table but not put the plumbing into place to make it useful. The reason I did that in this commit is to avoid annoying error messages. It won't work either way until you rebuild the DB, but it's slightly less annoying if you don't get a ton of error messages. Signed-off-by: Dan Carpenter --- check_check_deref.c | 2 +- check_deref.c | 2 +- check_deref_check.c | 2 +- check_dereferences_param.c | 4 ++-- check_err_ptr_deref.c | 2 +- check_free.c | 2 +- check_frees_param.c | 6 ++--- check_uninitialized.c | 2 +- smatch.h | 4 ++-- smatch_about_fn_ptr_arg.c | 4 ++-- smatch_container_of.c | 8 +++---- smatch_data/db/build_early_index.sh | 2 ++ smatch_data/db/reload_partial.sh | 4 ++++ smatch_data/db/return_implies.schema | 12 ++++++++++ smatch_data/db/smdb.py | 10 ++++---- smatch_db.c | 46 +++++++++++++++++++----------------- smatch_extra.c | 8 +++---- smatch_fn_arg_link.c | 6 ++--- smatch_param_used.c | 4 ++-- 19 files changed, 75 insertions(+), 55 deletions(-) create mode 100644 smatch_data/db/return_implies.schema diff --git a/check_check_deref.c b/check_check_deref.c index ba63c39f..f7e3fec3 100644 --- a/check_check_deref.c +++ b/check_check_deref.c @@ -154,6 +154,6 @@ void check_check_deref(int id) add_modification_hook(my_id, &is_ok); add_hook(&match_dereferences, DEREF_HOOK); add_hook(&match_pointer_as_array, OP_HOOK); - select_call_implies_hook(DEREFERENCE, &set_param_dereferenced); + select_return_implies_hook(DEREFERENCE, &set_param_dereferenced); add_hook(&match_condition, CONDITION_HOOK); } diff --git a/check_deref.c b/check_deref.c index c39fdc92..59561d96 100644 --- a/check_deref.c +++ b/check_deref.c @@ -286,7 +286,7 @@ void check_deref(int id) add_modification_hook(my_id, &is_ok); add_hook(&match_dereferences, DEREF_HOOK); add_hook(&match_pointer_as_array, OP_HOOK); - select_call_implies_hook(DEREFERENCE, &set_param_dereferenced); + select_return_implies_hook(DEREFERENCE, &set_param_dereferenced); add_hook(&match_condition, CONDITION_HOOK); add_hook(&match_declarations, DECLARATION_HOOK); add_hook(&match_assign, ASSIGNMENT_HOOK); diff --git a/check_deref_check.c b/check_deref_check.c index 4c94a61d..5d5f5144 100644 --- a/check_deref_check.c +++ b/check_deref_check.c @@ -89,6 +89,6 @@ void check_deref_check(int id) my_id = id; add_hook(&match_dereference, DEREF_HOOK); add_hook(&match_condition, CONDITION_HOOK); - select_call_implies_hook(DEREFERENCE, &set_param_dereferenced); + select_return_implies_hook(DEREFERENCE, &set_param_dereferenced); add_modification_hook(my_id, &underef); } diff --git a/check_dereferences_param.c b/check_dereferences_param.c index c4bafec0..25192491 100644 --- a/check_dereferences_param.c +++ b/check_dereferences_param.c @@ -106,7 +106,7 @@ static void process_states(void) name = get_param_name(tmp); if (!name) continue; - sql_insert_call_implies(DEREFERENCE, arg, name, "1"); + sql_insert_return_implies(DEREFERENCE, arg, name, "1"); } END_FOR_EACH_SM(tmp); } @@ -125,7 +125,7 @@ void check_dereferences_param(int id) add_hook(&match_dereference, DEREF_HOOK); add_hook(&match_pointer_as_array, OP_HOOK); - select_call_implies_hook(DEREFERENCE, &set_param_dereferenced); + select_return_implies_hook(DEREFERENCE, &set_param_dereferenced); add_modification_hook(my_id, &set_ignore); all_return_states_hook(&process_states); diff --git a/check_err_ptr_deref.c b/check_err_ptr_deref.c index 07e2a480..e01fb750 100644 --- a/check_err_ptr_deref.c +++ b/check_err_ptr_deref.c @@ -236,6 +236,6 @@ void check_err_ptr_deref(int id) err_ptr_rl = clone_rl_permanent(alloc_rl(err_ptr_min, err_ptr_max)); - select_call_implies_hook(DEREFERENCE, &set_param_dereferenced); + select_return_implies_hook(DEREFERENCE, &set_param_dereferenced); } diff --git a/check_free.c b/check_free.c index be84c15b..18b37c06 100644 --- a/check_free.c +++ b/check_free.c @@ -290,6 +290,6 @@ void check_free(int id) add_hook(&match_return, RETURN_HOOK); add_modification_hook(my_id, &ok_to_use); - select_call_implies_hook(PARAM_FREED, &set_param_freed); + select_return_implies_hook(PARAM_FREED, &set_param_freed); add_pre_merge_hook(my_id, &pre_merge_hook); } diff --git a/check_frees_param.c b/check_frees_param.c index 83ecdfb0..712f1ca7 100644 --- a/check_frees_param.c +++ b/check_frees_param.c @@ -76,7 +76,7 @@ static void match_free(const char *fn, struct expression *expr, void *param) static void set_param_freed(struct expression *call, struct expression *arg, char *key, char *unused) { - /* XXX FIXME: call_implies has been updated with more information */ + /* XXX FIXME: return_implies has been updated with more information */ if (strcmp(key, "$") != 0) return; freed_variable(arg); @@ -97,7 +97,7 @@ static void process_states(void) param_name = get_param_name(sm); if (!param_name) continue; - sql_insert_call_implies(PARAM_FREED, param, param_name, "1"); + sql_insert_return_implies(PARAM_FREED, param, param_name, "1"); } END_FOR_EACH_SM(sm); } @@ -115,7 +115,7 @@ void check_frees_param(int id) add_function_hook("free", &match_free, INT_PTR(0)); - select_call_implies_hook(PARAM_FREED, &set_param_freed); + select_return_implies_hook(PARAM_FREED, &set_param_freed); add_modification_hook(my_id, &set_ignore); all_return_states_hook(&process_states); diff --git a/check_uninitialized.c b/check_uninitialized.c index 84cbe04a..130c00be 100644 --- a/check_uninitialized.c +++ b/check_uninitialized.c @@ -190,7 +190,7 @@ static int member_is_used(struct expression *call, int param, char *printed_name found = 0; run_sql(¶m_used_callback, &found, - "select * from call_implies where %s and type = %d and parameter = %d and key = '%s';", + "select * from return_implies where %s and type = %d and parameter = %d and key = '%s';", get_static_filter(call->fn->symbol), PARAM_USED, param, printed_name); return found; } diff --git a/smatch.h b/smatch.h index 4c06fc5c..007f2ab4 100644 --- a/smatch.h +++ b/smatch.h @@ -767,7 +767,7 @@ void select_caller_info_hook(void (*callback)(const char *name, struct symbol *s void add_member_info_callback(int owner, void (*callback)(struct expression *call, int param, char *printed_name, struct sm_state *sm)); void add_split_return_callback(void (*fn)(int return_id, char *return_ranges, struct expression *returned_expr)); void add_returned_member_callback(int owner, void (*callback)(int return_id, char *return_ranges, struct expression *expr, char *printed_name, struct smatch_state *state)); -void select_call_implies_hook(int type, void (*callback)(struct expression *call, struct expression *arg, char *key, char *value)); +void select_return_implies_hook(int type, void (*callback)(struct expression *call, struct expression *arg, char *key, char *value)); struct range_list *db_return_vals(struct expression *expr); struct range_list *db_return_vals_from_str(const char *fn_name); char *return_state_to_var_sym(struct expression *expr, int param, const char *key, struct symbol **sym); @@ -856,7 +856,7 @@ void sql_insert_caller_info(struct expression *call, int type, int param, const char *key, const char *value); void sql_insert_function_ptr(const char *fn, const char *struct_name); void sql_insert_return_values(const char *return_values); -void sql_insert_call_implies(int type, int param, const char *key, const char *value); +void sql_insert_return_implies(int type, int param, const char *key, const char *value); void sql_insert_function_type_size(const char *member, const char *ranges); void sql_insert_local_values(const char *name, const char *value); void sql_insert_function_type_value(const char *type, const char *value); diff --git a/smatch_about_fn_ptr_arg.c b/smatch_about_fn_ptr_arg.c index 4a116077..347833f7 100644 --- a/smatch_about_fn_ptr_arg.c +++ b/smatch_about_fn_ptr_arg.c @@ -44,7 +44,7 @@ static int assigns_parameters(struct expression *fn, struct expression *arg) return 0; snprintf(buf, sizeof(buf), "%d", arg_param); - sql_insert_call_implies(FN_ARG_LINK, fn_param, "$", buf); + sql_insert_return_implies(FN_ARG_LINK, fn_param, "$", buf); return 1; } @@ -227,6 +227,6 @@ void register_about_fn_ptr_arg(int id) return; add_hook(match_assign_param, ASSIGNMENT_HOOK); add_hook(match_assign_function, ASSIGNMENT_HOOK); - select_call_implies_hook(FN_ARG_LINK, &check_passes_fn_and_data); + select_return_implies_hook(FN_ARG_LINK, &check_passes_fn_and_data); add_hook(&match_end_func, END_FUNC_HOOK); } diff --git a/smatch_container_of.c b/smatch_container_of.c index 9b1c4089..5c17ea66 100644 --- a/smatch_container_of.c +++ b/smatch_container_of.c @@ -176,7 +176,7 @@ static void process_states(void) name = get_container_name(tmp, offset); if (!name) continue; - sql_insert_call_implies(CONTAINER, arg, name, ""); + sql_insert_return_implies(CONTAINER, arg, name, ""); } END_FOR_EACH_SM(tmp); free_stree(&used_stree); @@ -216,7 +216,7 @@ static void print_returns_container_of(int return_id, char *return_ranges, struc snprintf(key, sizeof(key), "%d", param); snprintf(value, sizeof(value), "-%d", offset); - /* no need to add it to call_implies because it's not really param_used */ + /* no need to add it to return_implies because it's not really param_used */ sql_insert_return_states(return_id, return_ranges, CONTAINER, -1, key, value); } @@ -246,7 +246,7 @@ static void returns_container_of(struct expression *expr, int param, char *key, if (param < 0) return; snprintf(buf, sizeof(buf), "$(%d)", offset); - sql_insert_call_implies(CONTAINER, param, buf, ""); + sql_insert_return_implies(CONTAINER, param, buf, ""); } static struct expression *get_outer_struct(struct expression *expr) @@ -587,7 +587,7 @@ void register_container_of(int id) add_hook(&match_save_states, INLINE_FN_START); add_hook(&match_restore_states, INLINE_FN_END); - select_call_implies_hook(CONTAINER, &set_param_used); + select_return_implies_hook(CONTAINER, &set_param_used); all_return_states_hook(&process_states); add_split_return_callback(&print_returns_container_of); diff --git a/smatch_data/db/build_early_index.sh b/smatch_data/db/build_early_index.sh index b24a4a3a..58e7f2b2 100755 --- a/smatch_data/db/build_early_index.sh +++ b/smatch_data/db/build_early_index.sh @@ -17,6 +17,8 @@ CREATE INDEX common_fn_idx on common_caller_info (function, call_id); CREATE INDEX common_ff_idx on common_caller_info (file, function, call_id); CREATE INDEX call_implies_fn_idx on call_implies (function); CREATE INDEX call_implies_ff_idx on call_implies (file, function); +CREATE INDEX return_implies_fn_idx on return_implies (function); +CREATE INDEX return_implies_ff_idx on return_implies (file, function); CREATE INDEX data_file_info_idx on data_info (file, data); CREATE INDEX data_info_idx on data_info (data); CREATE INDEX fn_ptr_idx_file on function_ptr (file, function); diff --git a/smatch_data/db/reload_partial.sh b/smatch_data/db/reload_partial.sh index 1cce1dbb..34cdb26a 100755 --- a/smatch_data/db/reload_partial.sh +++ b/smatch_data/db/reload_partial.sh @@ -21,6 +21,7 @@ for c_file in $files; do echo "delete from caller_info where file = '$c_file';" | sqlite3 $db_file echo "delete from return_states where file = '$c_file';" | sqlite3 $db_file echo "delete from call_implies where file = '$c_file';" | sqlite3 $db_file + echo "delete from return_implies where file = '$c_file';" | sqlite3 $db_file done tmp_file=$(mktemp) @@ -34,6 +35,9 @@ ${bin_dir}/fill_db_sql.pl "$PROJ" $tmp_file $db_file grep "insert into call_implies" $info_file > $tmp_file ${bin_dir}/fill_db_sql.pl "$PROJ" $tmp_file $db_file +grep "insert into return_implies" $info_file > $tmp_file +${bin_dir}/fill_db_sql.pl "$PROJ" $tmp_file $db_file + rm $tmp_file ${bin_dir}/fixup_all.sh $db_file diff --git a/smatch_data/db/return_implies.schema b/smatch_data/db/return_implies.schema new file mode 100644 index 00000000..065d0f6d --- /dev/null +++ b/smatch_data/db/return_implies.schema @@ -0,0 +1,12 @@ +CREATE TABLE return_implies ( + file varchar(128), + function varchar(64), + call_id integer, + static boolean, + type integer, + parameter integer, + key varchar(256), + value varchar(256), + + CONSTRAINT implies_row UNIQUE (file, function, call_id, static, type, parameter, key, value) +); diff --git a/smatch_data/db/smdb.py b/smatch_data/db/smdb.py index 7f513489..f0ef5911 100755 --- a/smatch_data/db/smdb.py +++ b/smatch_data/db/smdb.py @@ -440,9 +440,9 @@ def print_return_states(func): print "| %13s |" %(type_to_str(txt[6])), print " %2d | %20s | %20s |" %(txt[7], txt[8], txt[9]) -def print_call_implies(func): +def print_return_implies(func): cur = con.cursor() - cur.execute("select * from call_implies where function = '%s';" %(func)) + cur.execute("select * from return_implies where function = '%s';" %(func)) count = 0 for txt in cur: if not count: @@ -602,10 +602,10 @@ elif sys.argv[1] == "return_states": func = sys.argv[2] print_return_states(func) print "================================================" - print_call_implies(func) -elif sys.argv[1] == "call_implies": + print_return_implies(func) +elif sys.argv[1] == "return_implies": func = sys.argv[2] - print_call_implies(func) + print_return_implies(func) elif sys.argv[1] == "type_size" or sys.argv[1] == "buf_size": struct_type = sys.argv[2] member = sys.argv[3] diff --git a/smatch_db.c b/smatch_db.c index 68358c9f..8b37784f 100644 --- a/smatch_db.c +++ b/smatch_db.c @@ -62,13 +62,13 @@ ALLOCATOR(returned_member_callback, "returned member callbacks"); DECLARE_PTR_LIST(returned_member_cb_list, struct returned_member_callback); static struct returned_member_cb_list *returned_member_callbacks; -struct call_implies_callback { +struct db_return_implies_callback { int type; void (*callback)(struct expression *call, struct expression *arg, char *key, char *value); }; -ALLOCATOR(call_implies_callback, "call_implies callbacks"); -DECLARE_PTR_LIST(call_implies_cb_list, struct call_implies_callback); -static struct call_implies_cb_list *call_implies_cb_list; +ALLOCATOR(db_return_implies_callback, "return_implies callbacks"); +DECLARE_PTR_LIST(return_implies_cb_list, struct db_return_implies_callback); +static struct return_implies_cb_list *return_implies_cb_list; void sql_exec(struct sqlite3 *db, int (*callback)(void*, int, char**, char**), void *data, const char *sql) { @@ -227,9 +227,9 @@ void sql_insert_function_ptr(const char *fn, const char *struct_name) struct_name); } -void sql_insert_call_implies(int type, int param, const char *key, const char *value) +void sql_insert_return_implies(int type, int param, const char *key, const char *value) { - sql_insert_or_ignore(call_implies, "'%s', '%s', %lu, %d, %d, %d, '%s', '%s'", + sql_insert_or_ignore(return_implies, "'%s', '%s', %lu, %d, %d, %d, '%s', '%s'", get_base_file(), get_function(), (unsigned long)__inline_fn, fn_static(), type, param, key, value); } @@ -493,7 +493,7 @@ void sql_select_return_states(const char *cols, struct expression *call, cols, get_static_filter(call->fn->symbol)); } -void sql_select_call_implies(const char *cols, struct expression *call, +void sql_select_return_implies(const char *cols, struct expression *call, int (*callback)(void*, int, char**, char**)) { if (call->fn->type != EXPR_SYMBOL || !call->fn->symbol) @@ -501,12 +501,12 @@ void sql_select_call_implies(const char *cols, struct expression *call, if (inlinable(call->fn)) { mem_sql(callback, call, - "select %s from call_implies where call_id = '%lu';", + "select %s from return_implies where call_id = '%lu';", cols, (unsigned long)call); return; } - run_sql(callback, call, "select %s from call_implies where %s;", + run_sql(callback, call, "select %s from return_implies where %s;", cols, get_static_filter(call->fn->symbol)); } @@ -583,13 +583,13 @@ void add_returned_member_callback(int owner, void (*callback)(int return_id, cha add_ptr_list(&returned_member_callbacks, member_callback); } -void select_call_implies_hook(int type, void (*callback)(struct expression *call, struct expression *arg, char *key, char *value)) +void select_return_implies_hook(int type, void (*callback)(struct expression *call, struct expression *arg, char *key, char *value)) { - struct call_implies_callback *cb = __alloc_call_implies_callback(0); + struct db_return_implies_callback *cb = __alloc_db_return_implies_callback(0); cb->type = type; cb->callback = callback; - add_ptr_list(&call_implies_cb_list, cb); + add_ptr_list(&return_implies_cb_list, cb); } struct return_info { @@ -764,7 +764,7 @@ static void print_container_struct_members(struct expression *call, struct expre * */ run_sql(¶m_used_callback, &container, - "select key from call_implies where %s and type = %d and key like '%%$(%%' and parameter = %d limit 1;", + "select key from return_implies where %s and type = %d and key like '%%$(%%' and parameter = %d limit 1;", get_static_filter(call->fn->symbol), CONTAINER, param); if (!container) return; @@ -1065,10 +1065,10 @@ free_ptr_names: free_stree(&data.final_states); } -static int call_implies_callbacks(void *_call, int argc, char **argv, char **azColName) +static int return_implies_callbacks(void *_call, int argc, char **argv, char **azColName) { struct expression *call_expr = _call; - struct call_implies_callback *cb; + struct db_return_implies_callback *cb; struct expression *arg = NULL; int type; int param; @@ -1079,7 +1079,7 @@ static int call_implies_callbacks(void *_call, int argc, char **argv, char **azC type = atoi(argv[1]); param = atoi(argv[2]); - FOR_EACH_PTR(call_implies_cb_list, cb) { + FOR_EACH_PTR(return_implies_cb_list, cb) { if (cb->type != type) continue; if (param != -1) { @@ -1093,10 +1093,10 @@ static int call_implies_callbacks(void *_call, int argc, char **argv, char **azC return 0; } -static void match_call_implies(struct expression *expr) +static void match_return_implies(struct expression *expr) { - sql_select_call_implies("function, type, parameter, key, value", expr, - call_implies_callbacks); + sql_select_return_implies("function, type, parameter, key, value", expr, + return_implies_callbacks); } static void print_initializer_list(struct expression_list *expr_list, @@ -1911,6 +1911,7 @@ static void reset_memdb(struct symbol *sym) mem_sql(NULL, NULL, "delete from caller_info;"); mem_sql(NULL, NULL, "delete from return_states;"); mem_sql(NULL, NULL, "delete from call_implies;"); + mem_sql(NULL, NULL, "delete from return_implies;"); } static void match_end_func_info(struct symbol *sym) @@ -1937,6 +1938,7 @@ static void init_memdb(void) "db/function_type_size.schema", "db/type_size.schema", "db/call_implies.schema", + "db/return_implies.schema", "db/function_ptr.schema", "db/local_values.schema", "db/function_type_value.schema", @@ -1995,7 +1997,7 @@ static void init_cachedb(void) char *err = NULL; int rc; const char *schema_files[] = { - "db/call_implies.schema", + "db/return_implies.schema", "db/type_info.schema", }; static char buf[4096]; @@ -2063,7 +2065,7 @@ static void dump_cache(struct symbol_list *sym_list) if (!option_info) return; cache_sql(&save_cache_data, (char *)"type_info", "select * from type_info;"); - cache_sql(&save_cache_data, (char *)"call_implies", "select * from call_implies;"); + cache_sql(&save_cache_data, (char *)"return_implies", "select * from return_implies;"); } void open_smatch_db(void) @@ -2205,7 +2207,7 @@ void register_definition_db_callbacks(int id) add_hook(&match_after_func, AFTER_FUNC_HOOK); add_hook(&match_data_from_db, FUNC_DEF_HOOK); - add_hook(&match_call_implies, CALL_HOOK_AFTER_INLINE); + add_hook(&match_return_implies, CALL_HOOK_AFTER_INLINE); register_common_funcs(); register_return_replacements(); diff --git a/smatch_extra.c b/smatch_extra.c index 6cfc6c0c..5e63aabc 100644 --- a/smatch_extra.c +++ b/smatch_extra.c @@ -2169,14 +2169,14 @@ static int filter_unused_kzalloc_info(struct expression *call, int param, char * return 0; run_sql(¶m_used_callback, &found, - "select * from call_implies where %s and type = %d and parameter = %d and key = '%s';", + "select * from return_implies where %s and type = %d and parameter = %d and key = '%s';", get_static_filter(call->fn->symbol), PARAM_USED, param, printed_name); if (found) return 0; /* If the database is not built yet, then assume everything is used */ run_sql(¶m_used_callback, &found, - "select * from call_implies where %s and type = %d;", + "select * from return_implies where %s and type = %d;", get_static_filter(call->fn->symbol), PARAM_USED); if (!found) return 0; @@ -2647,7 +2647,7 @@ void register_smatch_extra_late(int id) add_modification_hook(link_id, &match_link_modify); add_hook(&match_dereferences, DEREF_HOOK); add_hook(&match_pointer_as_array, OP_HOOK); - select_call_implies_hook(DEREFERENCE, &set_param_dereferenced); + select_return_implies_hook(DEREFERENCE, &set_param_dereferenced); add_hook(&match_function_call, FUNCTION_CALL_HOOK); add_hook(&match_assign, ASSIGNMENT_HOOK); add_hook(&match_assign, GLOBAL_ASSIGNMENT_HOOK); @@ -2658,5 +2658,5 @@ void register_smatch_extra_late(int id) add_member_info_callback(my_id, struct_member_callback); add_split_return_callback(&returned_struct_members); - add_hook(&assume_indexes_are_valid, OP_HOOK); +// add_hook(&assume_indexes_are_valid, OP_HOOK); } diff --git a/smatch_fn_arg_link.c b/smatch_fn_arg_link.c index ce6a781a..daff38c4 100644 --- a/smatch_fn_arg_link.c +++ b/smatch_fn_arg_link.c @@ -92,7 +92,7 @@ static int print_calls_parameter(struct expression *call) return 0; snprintf(buf, sizeof(buf), "%d", arg_param); - sql_insert_call_implies(FN_ARG_LINK, fn_param, "$", buf); + sql_insert_return_implies(FN_ARG_LINK, fn_param, "$", buf); return 0; } @@ -178,7 +178,7 @@ static void check_passes_fn_and_data(struct expression *call, struct expression char buf[32]; snprintf(buf, sizeof(buf), "%d", arg_param); - sql_insert_call_implies(FN_ARG_LINK, fn_param, "$", buf); + sql_insert_return_implies(FN_ARG_LINK, fn_param, "$", buf); return; } @@ -207,6 +207,6 @@ void register_fn_arg_link(int id) return; add_hook(&match_call_info, FUNCTION_CALL_HOOK); - select_call_implies_hook(FN_ARG_LINK, &check_passes_fn_and_data); + select_return_implies_hook(FN_ARG_LINK, &check_passes_fn_and_data); } diff --git a/smatch_param_used.c b/smatch_param_used.c index 16736422..80d390d3 100644 --- a/smatch_param_used.c +++ b/smatch_param_used.c @@ -70,7 +70,7 @@ static void process_states(void) if (!name) continue; - sql_insert_call_implies(PARAM_USED, arg, name, ""); + sql_insert_return_implies(PARAM_USED, arg, name, ""); } END_FOR_EACH_SM(tmp); free_stree(&used_stree); @@ -104,6 +104,6 @@ void register_param_used(int id) add_hook(&match_save_states, INLINE_FN_START); add_hook(&match_restore_states, INLINE_FN_END); - select_call_implies_hook(PARAM_USED, &set_param_used); + select_return_implies_hook(PARAM_USED, &set_param_used); all_return_states_hook(&process_states); } -- 2.11.4.GIT