slist: fix "stack not empty" errors
commitbdbeaee0221e437e3f4b2b2ec07bba4b7718f448
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 15 Jan 2015 11:52:05 +0000 (15 14:52 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Thu, 15 Jan 2015 11:52:05 +0000 (15 14:52 +0300)
treee433e4676fd796d838e3b40ca3d4536071fb813d
parent68a8d9b53b7c011621fa0871a83e253b9ad8b534
slist: fix "stack not empty" errors

Adding the pre_merge_hooks caused some "stack not empty" messages, which
presumably means that flow analysis is broken.

1) Improve the debugging by making the "stack not empty" messages print the
function name where the bug happens.

2) In smatch_states then clean things up a bit and also fix a memory leak
I noticed while looking for this bug.

3) In pre merges then don't try to be clever, just use the big hammer
method of saving the entire state, faking a simple current state, and
then restoring all the state.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch_flow.c
smatch_slist.c
smatch_states.c