core: fix handling of switch statements with unreachable declarations
commit2385ca54bbb85efbc5c6b3f49a06d9e14b1df441
authorDan Carpenter <error27@gmail.com>
Fri, 23 Apr 2010 13:58:15 +0000 (23 15:58 +0200)
committerDan Carpenter <error27@gmail.com>
Fri, 23 Apr 2010 13:58:15 +0000 (23 15:58 +0200)
tree4f800bc7616faa02f09bacb03957cbb070a0e8ce
parent2ab9f934c809caa258383225023776e3c8872874
core: fix handling of switch statements with unreachable declarations

If you have code like:
switch(foo) {
int a;
case 1:
frob();

The declaration of "a" is not reachable.  There are some scripts which want
to set the state of "a" to &undefined, but we don't allow setting of states
in unreachable code.  At least we shouldn't, but there was a bug introduced
and we do.  This patch changes it back to the not allowing people to set
states in unreachable code.

The reason we don't allow it, is because if we don't have a proper slist
then merge_slist() improperly sets the unbalanced stuff to &undefined.

Signed-off-by: Dan Carpenter <error27@gmail.com>
smatch_states.c