Fix the widening operator of the Map functor

Summary:
This commit avoids using the join operator for the widening
of the Map functor in ```abstractDomain.ml```
and ensures termination when ```ValueDomain``` is infinite
by using ```ValueDomain.widen```.
Closes https://github.com/facebook/infer/pull/535

Differential Revision: D4319797

Pulled By: sblackshear

fbshipit-source-id: 16f15e4
master
Kihong Heo 8 years ago committed by Facebook Github Bot
parent 23a0a611dc
commit 42a3176882

@ -156,8 +156,17 @@ module Map (M : PrettyPrintable.PPMap) (ValueDomain : S) = struct
astate1 astate1
astate2 astate2
let widen ~prev ~next ~num_iters:_ = let widen ~prev ~next ~num_iters =
join prev next if phys_equal prev next
then prev
else
M.merge
(fun _ v1_opt v2_opt -> match v1_opt, v2_opt with
| Some v1, Some v2 -> Some (ValueDomain.widen ~prev:v1 ~next:v2 ~num_iters)
| Some v, _ | _, Some v -> Some v
| None, None -> None)
prev
next
let pp fmt astate = let pp fmt astate =
M.pp ~pp_value:ValueDomain.pp fmt astate M.pp ~pp_value:ValueDomain.pp fmt astate

Loading…
Cancel
Save