implied: fix leaf checking
commit2ee5d3b211b9c12b995a18cbd5dddc00db67acfc
authorDan Carpenter <dan.carpenter@linaro.org>
Mon, 8 Apr 2024 15:47:37 +0000 (8 18:47 +0300)
committerDan Carpenter <dan.carpenter@linaro.org>
Mon, 8 Apr 2024 15:47:37 +0000 (8 18:47 +0300)
tree498bf145239078e0ff3134e227d2b8dd53ca8de2
parent87ccaba1653caf265ee647e68fd7b03f40db1f9b
implied: fix leaf checking

Hm...  I thought I had committed this.  The interesting part of this is
in get_tf_stacks_from_pool().  What happens is that when we're parsing
return statements then we take the string "ret = 1" or "ret = 0-u64max"
and then we look at all the leaf nodes where that is true.

However, actually it wasn't checking leaf nodes, it was checking merged
nodes as well.  And when we merge 1 and 0-u64max then the merged range
is still 0-u64max.  So we end up saying there basically are no implication
on that path.  (The 0-u64max value might not be the interesting bit, it's
just a marker for the path and there might be interesting implications on
that path).

The is_merged() -> is_leaf() change in sm_in_keep_leafs() is just for
correctness and might not fix a real life bug at all.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
smatch_implied.c