states: fix handling switches inside conditions (fake_cur_stree)
commitfc13c666b3a31d7e90d94b29c876ead3d992b3ad
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 11 Apr 2017 12:57:03 +0000 (11 15:57 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Tue, 11 Apr 2017 12:57:03 +0000 (11 15:57 +0300)
treeffd27da1ea69163dbb2a655dec14b0b235ebaad3
parent09f24bcfa60f0cc0abc260122996659d4f04f894
states: fix handling switches inside conditions (fake_cur_stree)

This is broken from when I re-worked how the fake_cur_stree worked.  Before
that we used to randomly merge the fake_cur_stree with the cur_stree.  It
had really complicated side effects but one side effect was that this stuff
used to work.

In the current code what was happening was that when we did a break we
would discard everything from the fake_cur_stree.

Now we create a new fake stream to store these states.  We can't merge them
in with the cur_stree because we're supposed to be able to discard all
fake states.  We also can't just mix the cur_stree in with the fake
stree.  The design of the fake stree is that we have to keep it separate.
It's a little bit more complicated in some way, but more precise and
transparent in other ways...

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch_states.c
validation/sm_switch3.c [new file with mode: 0644]