comparison: track modifications better using var_sym_lists
commitcb978afa8103700fab46acd4b0e0d7d5446ad938
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 2 Jul 2013 21:19:41 +0000 (3 00:19 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Tue, 2 Jul 2013 21:19:41 +0000 (3 00:19 +0300)
tree632ea28dbae650543e2a00e24c57aa9f3d4d6598
parentf1b95e27897d05249b0f67ddb968268b8bd42db7
comparison: track modifications better using var_sym_lists

The problem is that chunks didn't have an attached symbol, so when we
inherit comparisons then the links weren't getting copied correctly.
What I mean by inherit comparisons is this, if we know "a + b < c" and
"c < d" then when know that "a + b < d".  But we don't have a symbol
pointer for "a" or "b" so we can't update the links correctly so that when
we modify "b" the relationship is destroyed.  (We want it to be destroyed
but it's not).

I have addressed this pointer by adding a var_sym_list so we can store the
necessary info.

This change breaks validation/sm_compare11.c.  That bug was there in the
original code, it's only exposed by this change, it's not introduce by this
change.  I will fix it in a later patch.

I will also get rid of the sym1 and sym2 pointers in later patches and do
some further cleanup work.
smatch_comparison.c
validation/sm_compare12.c