From 97e7effbd290f5ba10a3a65fd0a252b5e0961703 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Wed, 18 Feb 2009 22:44:28 +0300 Subject: [PATCH] Move the implications checking to after the scripts have set their states. I wasn't able to find a place where this makes a difference but it seems like a good idea conceptually. Signed-off-by: Dan Carpenter --- smatch.c | 6 +++++- smatch_implied.c | 7 +++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/smatch.c b/smatch.c index 105e9f05..25df631e 100644 --- a/smatch.c +++ b/smatch.c @@ -18,18 +18,22 @@ void register_smatch_ignore(int id); void register_overflow(int id); void register_locking(int id); void register_memory(int id); +void register_implications(int id); /* <- your test goes here */ /* void register_template(int id); */ const reg_func reg_funcs[] = { - ®ister_smatch_extra, + ®ister_smatch_extra, /* smatch_extra always has to be first */ ®ister_smatch_ignore, ®ister_null_deref, ®ister_overflow, ®ister_locking, ®ister_memory, + /* <- your test goes here */ /* ®ister_template, */ + + ®ister_implications, /* implications always has to be last */ NULL }; diff --git a/smatch_implied.c b/smatch_implied.c index 9b3c54d2..648d1945 100644 --- a/smatch_implied.c +++ b/smatch_implied.c @@ -80,10 +80,8 @@ static struct state_list *get_eq_neq_filtered(struct sm_state *sm_state, return ret; } - /* * This condition hook is very connected to smatch_extra.c. - * It's registered there. */ void __implied_states_hook(struct expression *expr) @@ -127,3 +125,8 @@ void __implied_states_hook(struct expression *expr) free_string(name); } + +void register_implications(int id) +{ + add_hook(&__implied_states_hook, CONDITION_HOOK); +} -- 2.11.4.GIT