From c40ec43c93ca4dd2e989d3349aa2e504477f2c8f Mon Sep 17 00:00:00 2001 From: Julian Erhard Date: Tue, 28 Nov 2023 18:42:56 +0100 Subject: [PATCH] Consider is_modular for Addr.of_mval, of_var. Pass this flag an the variable to varinfo_or_canonical that may choose to select a canoncial representation for the variable. --- src/cdomains/addressDomain.ml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/cdomains/addressDomain.ml b/src/cdomains/addressDomain.ml index 9bce935259..53f4d936de 100644 --- a/src/cdomains/addressDomain.ml +++ b/src/cdomains/addressDomain.ml @@ -76,8 +76,12 @@ module AddressPrintable (Mval: Mval.Printable) = struct include AddressBase (Mval) - let of_var ~is_modular x = Addr (x, `NoOffset) - let of_mval ~is_modular (x, o) = Addr (x, o) + let of_mval ~is_modular (x, o) = + let x = ModularUtil0.varinfo_or_canonical ~is_modular x in + Addr (x, o) + + let of_var ~is_modular x = + of_mval ~is_modular (x, `NoOffset) let to_var = function | Addr (x,_) -> Some x