@@ -612,10 +612,7 @@ struct
612612 | (Int x , Int y ) -> (try Int (ID. join x y) with IntDomain. IncompatibleIKinds m -> Messages. warn ~category: Analyzer ~tags: [Category Imprecise ] " %s" m; Top )
613613 | (Float x , Float y ) -> Float (FD. join x y)
614614 | (Int x, Address y)
615- | (Address y , Int x ) -> Address (match ID. equal_to Z. zero x with (* TODO: AD.of_int? *)
616- | `Eq -> AD. join AD. null_ptr y
617- | `Neq -> AD. (join y not_null)
618- | `Top -> AD. join y AD. top_ptr)
615+ | (Address y , Int x ) -> Address (AD. join y (AD. of_int x))
619616 | (Address x , Address y ) -> Address (AD. join x y)
620617 | (Struct x , Struct y ) -> Struct (Structs. join x y)
621618 | (Union x , Union y ) -> Union (Unions. join x y)
@@ -645,10 +642,7 @@ struct
645642 | (Float x , Float y ) -> Float (FD. widen x y)
646643 (* TODO: symmetric widen, wtf? *)
647644 | (Int x, Address y)
648- | (Address y , Int x ) -> Address (match ID. equal_to Z. zero x with (* TODO: AD.of_int? *)
649- | `Eq -> AD. widen AD. null_ptr (AD. join AD. null_ptr y)
650- | `Neq -> AD. (widen y (join y not_null))
651- | `Top -> AD. widen y (AD. join y AD. top_ptr))
645+ | (Address y , Int x ) -> Address (AD. widen y (AD. join y (AD. of_int x)))
652646 | (Address x , Address y ) -> Address (AD. widen x y)
653647 | (Struct x , Struct y ) -> Struct (Structs. widen x y)
654648 | (Union x , Union y ) -> Union (Unions. widen x y)
0 commit comments