return_to_param: fix a crashing bug
commit215c7ada006d3badc4fc28bd1b8f5f03fddf04b3
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 6 Mar 2018 14:14:48 +0000 (6 17:14 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Tue, 6 Mar 2018 14:14:48 +0000 (6 17:14 +0300)
tree19331745418e02c7668567604a69e2683f30d482
parent4d6a2546b5a98d3386edfc159dad5ca9b9bb6a70
return_to_param: fix a crashing bug

This started happening when I upgraded to the latest Sparse.

So I'm not totally sure why I did this HACK ALERT...  And I also can't
swear that this fix is correct because the test cases aren't there...

But what happens is that we use the left_sym, because it gets passed to
smatch_extra mod expression.  So the hack says we don't use it but that's
wrong.  Then check_rosenberg.c hooks into smatch_extra and looks up the
type of the symbol which doesn't work since it's an expression pointer.
And it cause a crash.

I think this fix will work 99 times out of a hundred and it's probably
harmless the remaining time.

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