diff --git a/infer/src/absint/AbstractInterpreter.ml b/infer/src/absint/AbstractInterpreter.ml index db7d1ed85..441a569ff 100644 --- a/infer/src/absint/AbstractInterpreter.ml +++ b/infer/src/absint/AbstractInterpreter.ml @@ -104,12 +104,17 @@ struct let rec exec_worklist cfg work_queue inv_map proc_data ~debug = let compute_pre node inv_map = let extract_post_ pred = extract_post (CFG.id pred) inv_map in - let all_posts = List.map ~f:extract_post_ (CFG.preds cfg node) in - match List.filter_opt all_posts with - | post :: posts -> - Some (List.fold ~f:Domain.join ~init:post posts) - | [] -> - None + CFG.preds cfg node + |> List.fold ~init:None ~f:(fun joined_post_opt pred -> + match extract_post_ pred with + | None -> + joined_post_opt + | Some post as some_post -> + match joined_post_opt with + | None -> + some_post + | Some joined_post -> + Some (Domain.join joined_post post) ) in match Scheduler.pop work_queue with | Some (_, [], work_queue') ->