helper: fix get_array_expr()
commit50c3646c8b72fc2f892f395a1f22c9c45d0d5f72
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 31 Oct 2017 11:21:28 +0000 (31 14:21 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Tue, 31 Oct 2017 11:21:28 +0000 (31 14:21 +0300)
tree3c7bfcd858d99354f9d3cb55f8ca55ce7ca447e7
parent82055133cec13c4934bf072af96f801b03131693
helper: fix get_array_expr()

The problem here is that say you have a statement like:

foo[x] = whatever();

When we're parsing the assignment, the parent of foo[x] hasn't been
initialized yet, so get_array_expr() returns NULL.  Then later it does
get initialized and after that it returns the correct thing.  So we end
up creating two states in smatch_extra which aren't in sync.

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