Skip to content

BaseAnalysis: Investigate why join over alternatives for non-definite AD target does not work #1465

@michael-schwarz

Description

@michael-schwarz

For #1458 I also attempted to replace this snippet

analyzer/src/analyses/base.ml

Lines 1735 to 1743 in 5cd8650

(* We start from the current state and an empty list of global deltas,
* and we assign to all the the different possible places: *)
let nst = AD.fold update_one lval st in
(* if M.tracing then M.tracel "set" ~var:firstvar "new state1 %a" CPA.pretty nst; *)
(* If the address was definite, then we just return it. If the address
* was ambiguous, we have to join it with the initial state. *)
let nst = if AD.cardinal lval > 1 then { nst with cpa = CPA.join st.cpa nst.cpa } else nst in
(* if M.tracing then M.tracel "set" ~var:firstvar "new state2 %a" CPA.pretty nst; *)
nst

with

AD.fold (fun addr acc -> D.join (update_one addr st) acc) lval (D.bot ())

but that lead to some strange test failures where I really have no idea what's going on:

3 test(s) failed: ["04/35 trylock_rc", "04/36 trylock_nr", "41/05 more"]

This would be the cleaner solution, so we should investigate it.

Originally posted by @michael-schwarz in #1458 (comment)

Metadata

Metadata

Assignees

Labels

cleanupRefactoring, clean-up

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions