Skip to content
Snippets Groups Projects
Commit 195afbff authored by Valentin Perrelle's avatar Valentin Perrelle Committed by David Bühler
Browse files

[Dive] Fix temporary variables locations

parent f49ba50d
No related branches found
No related tags found
No related merge requests found
...@@ -128,8 +128,11 @@ let stmt_to_node_locality stmt = ...@@ -128,8 +128,11 @@ let stmt_to_node_locality stmt =
let build_node_locality kinstr kind = let build_node_locality kinstr kind =
match Node_kind.get_base kind with match Node_kind.get_base kind with
| Some vi -> | Some vi ->
let loc_function = Kernel_function.find_defining_kf vi let loc_function = Kernel_function.find_defining_kf vi in
and loc_file = get_loc_filename vi.vdecl in (* Use the location of the defining function if it exists, as some
temporary variables do not have proper location *)
let def_vi = Extlib.may_map Kernel_function.get_vi ~dft:vi loc_function in
let loc_file = get_loc_filename def_vi.vdecl in
{ loc_file ; loc_function } { loc_file ; loc_function }
| None -> | None ->
match kinstr with match kinstr 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