flow/expressions/function_hooks: re-fix is_assigned_call()
commit595514a1ba6087f9d46b4bb0e5d868b40db9a82f
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 20 Apr 2018 12:59:06 +0000 (20 15:59 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Fri, 20 Apr 2018 12:59:06 +0000 (20 15:59 +0300)
tree4f3780c978406febace41d493cf9bd0094f30d9c
parentd4b139a088fa5d67dda3c611d8d848e83c884895
flow/expressions/function_hooks: re-fix is_assigned_call()

The is_assigned_call() is totally essential so that we don't parse function
calls twice as an assignment and then as a normal function call.

It's pretty complicated because we do a bunch of fake assignments.  For
initializers, for things like "foo = bar() ?: 0;" or
"foo = (({blah; blah; bar();}));".  It's not always clear what the ->parent
struct should be I think...

Anyway, this change sort of reverts it to how it used to be.  In
assign_expression() we allocate a normal expression struct so it isn't
freed at the end of the function and we set the ->parent to then
assignment.

There is still an issue where I guess we parse the call first, then fake
an assignment, and then parse that.  It's the reverse order from normal so
we end up parsing the function twice and it causes one or two puzzling
false positives in the kernel.  I need to think about that.

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