states: only set the fake_stree in set_state()
commite1c171580117edd08f388dc4ae273c37bd9de8d2
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 17 Feb 2016 10:13:45 +0000 (17 13:13 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Wed, 17 Feb 2016 10:13:45 +0000 (17 13:13 +0300)
tree30075d3dd3b472dfda148e6d74fdac792f5516c1
parent240b25287358036cc6b50c8e4a89a1fc4f278fff
states: only set the fake_stree in set_state()

I'm trying to untangle how the fake stree is used so that it's a bit
more explicit what's happening.

The complicated bit of this patch is:
- if (fake_cur_stree_stack)
+ if (fake_cur_stree_stack && owner != -1)

The issue there is that this is called from Smatch implied like this:

        __push_fake_cur_stree();
        __unnullify_path();
        set_extra_nomod(name, sym, alloc_estate_rl(rl));
        extra_states = __pop_fake_cur_stree();

If we don't allow -1 to go through then we can unnullify the path.

Hm...  That seems more complicated than necessary.

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