Skip to content

Commit d2840fb

Browse files
committed
Fix offset handling when adding 0 to field offsets
1 parent fd82abd commit d2840fb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/analyses/base.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ struct
268268
begin match IdxDom.(to_bool (eq f_offset (neg (iDtoIdx n)))) with
269269
| Some true -> `NoOffset
270270
| _ when isArrayType f.ftype -> `Field (f, `Index (n, `NoOffset))
271-
| _ when GobOption.exists (Z.equal Z.zero) (ID.to_int n) -> `NoOffset (* adding (or subtracting) 0 to any type of pointer is ok *)
271+
| _ when GobOption.exists (Z.equal Z.zero) (ID.to_int n) -> `Field (f, `NoOffset) (* adding (or subtracting) 0 to any type of pointer is ok *)
272272
| _ -> raise UnknownPtr (* adding (or subtracting) anything else than 0 to a pointer that is non-indexable will yield an unknown pointer *)
273273
end
274274
| `Index (i, o) ->

0 commit comments

Comments
 (0)