Skip to content
Snippets Groups Projects
Commit 4dabb947 authored by Valentin Perrelle's avatar Valentin Perrelle
Browse files

[dive] build scalar nodes for lvalues even if the code is dead

parent 745934ee
No related branches found
No related tags found
No related merge requests found
...@@ -200,12 +200,17 @@ let enumerate_cells ~is_folded_base ~limit lval kinstr = ...@@ -200,12 +200,17 @@ let enumerate_cells ~is_folded_base ~limit lval kinstr =
with Abstract_interp.Error_Top -> raise Unknown_location with Abstract_interp.Error_Top -> raise Unknown_location
let build_node_kind ~is_folded_base lval kinstr = let build_node_kind ~is_folded_base lval kinstr =
match enumerate_cells ~is_folded_base ~limit:1 lval kinstr with match lval with
| [node_kind] -> node_kind | Var vi, offset ->
| [] (* happens if kinstr is dead code *) -> Scattered (lval, kinstr) (* Build a scalar node even if kinstr is dead *)
| _ -> assert false Scalar (vi, Cil.typeOfLval lval, offset)
| exception (Too_many_deps _) -> Scattered (lval, kinstr) | Mem _, _ ->
| exception Unknown_location -> Unknown (lval, kinstr) match enumerate_cells ~is_folded_base ~limit:1 lval kinstr with
| [node_kind] -> node_kind
| [] (* happens if kinstr is dead code *) -> Scattered (lval, kinstr)
| _ -> assert false
| exception (Too_many_deps _) -> Scattered (lval, kinstr)
| exception Unknown_location -> Unknown (lval, kinstr)
let default_node_locality callstack = let default_node_locality callstack =
match callstack with match callstack with
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment