constraints: fix set_equiv()
commitd0ab5ec04d9006ca75b65f508dd303c35bdb7b09
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 25 May 2012 17:33:07 +0000 (25 20:33 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Sat, 26 May 2012 15:41:11 +0000 (26 18:41 +0300)
tree7110fdc96c00ae176bee80504cd1536294355fe2
parent9e6937d6d54e9b9d2cad834174e452c640ceec45
constraints: fix set_equiv()

The way this should work really is to generate a list of related states
(an rlist).  Then set all the ->related stuff to that same list.  Once
a state is set we shouldn't change the ->related list again.

Also:
- state = clone_estate(right_sm->state);
- if (!estate_related(state))

clone_estate() returns with a NULL ->related pointer so that didn't work.

I moved the function down so it could use the add_related() function and
because it belongs toward the bottom of the file.

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