Skip to content

Commit d22f333

Browse files
committed
Strip casts in var_eq assume
Pointer equalities have casts in front of Lval.
1 parent 2e9e5d8 commit d22f333

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/analyses/varEq.ml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -399,9 +399,14 @@ struct
399399

400400
let rec assume ask exp st =
401401
match exp with
402-
| BinOp (Eq, Lval lval, exp, t)
403-
| BinOp (Eq, exp, Lval lval, t) ->
404-
add_eq ask lval exp st
402+
| BinOp (Eq, e1, e2, t) ->
403+
begin match stripCasts e1, stripCasts e2 with
404+
| Lval lval, exp
405+
| exp, Lval lval ->
406+
add_eq ask lval exp st
407+
| _, _ ->
408+
st
409+
end
405410
| BinOp (LAnd, e1, e2, _) ->
406411
assume ask e2 (assume ask e1 st)
407412
| BinOp (LOr, e1, e2, _) ->

0 commit comments

Comments
 (0)