handle known conditions better
commit1b3bc6f7749408cd09d299b1b2779ea8ce425266
authorDan Carpenter <error27@gmail.com>
Tue, 17 Mar 2009 22:34:32 +0000 (18 01:34 +0300)
committerDan Carpenter <error27@gmail.com>
Tue, 17 Mar 2009 22:34:32 +0000 (18 01:34 +0300)
tree2a8af86135060e5ba18029217bae4167acea2a84
parentd4c7d9b63e6c31c9730926a1d78e2bb6c1232736
handle known conditions better

Conditions are known maybe because it is an if (1) for certain configs, or
maybe certain paths are not used on the first iteration through a loop, or
maybe it's just sloppiness.  Anyway, it leads to false positives if you
don't handle it.

This patch makes if statements not branch if the condition is known.  Also
it only checks the appropriate code path ->if_true or ->if_false.  I've
also made the known_condition_true/false() functions a bit cleverer.

Signed-off-by: Dan Carpenter <error27@gmail.com>
smatch_extra.c
smatch_flow.c
validation/sm_null_deref.c
validation/sm_params.c