extra: fix function comparisons
Say you have a comparison like:
if (xxx_variable >= function()) {
What's important is that the function is the constant in this case and the
xxx_variable is what we interested in. The old code handled this really
badly.
In the old code, if function() returned a single known value then that
was treated like a special case and handled by the comparison code in
Smatch extra. But if the function set parameters, then that wasn't
recorded.
It should all have been handled in smatch_function_hooks.c. Unfortunately,
that code was broken on the false side of the comparison, because in
compare_db_return_states_callbacks() then it called set_return_state()
after it had already popped the fake cur_stree. On the true side, it
called set_return_state() twice but that was a harmless mistake.
The other bug, was that it faked an assignment which is not what we wanted,
but probably also harmless.
Anyway, I did some clearn up to create separate set_return_assign_state()
and set_other_side_state() functions.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>