recurse, extra: introduce has_variable() and fix forever loop OOM crash
commitb233c20564de894d847a605a1c2c31e68993264c
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 10 Jun 2013 11:13:16 +0000 (10 14:13 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Mon, 10 Jun 2013 11:13:16 +0000 (10 14:13 +0300)
tree8c8ff9f133af5db99808785a34724b01ba6a59f2
parent0a44af90acce532562d5df64a7acfb7fae6a7da3
recurse, extra: introduce has_variable() and fix forever loop OOM crash

There was a loop in smatch_extra which was causing problems when you
assigned a variable like this:

foo = foo + bar;

I have stopped this by introducing the has_variable() function so you can
check if "foo + bar" has the foo variable.  I have removed the checks for
is_simple_math() because those aren't needed at all.

The one thing to be aware of is that has_variable() is not totally complete
and it doesn't search very deeply.  If it errors out then it returns -1.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Makefile
smatch.h
smatch_extra.c
smatch_recurse.c [new file with mode: 0644]