From 119672894df475e7f438f4cb6185abf00c9605a7 Mon Sep 17 00:00:00 2001 From: Sam Blackshear Date: Tue, 18 Apr 2017 09:57:52 -0700 Subject: [PATCH] [thread-safety] use real location for trace spacers Reviewed By: jberdine Differential Revision: D4906402 fbshipit-source-id: 77f63c6 --- infer/src/checkers/ThreadSafety.ml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/infer/src/checkers/ThreadSafety.ml b/infer/src/checkers/ThreadSafety.ml index ee15d7ee0..f00171df1 100644 --- a/infer/src/checkers/ThreadSafety.ml +++ b/infer/src/checkers/ThreadSafety.ml @@ -987,10 +987,15 @@ let make_trace_with_conflicts conflicts original_path pdesc = | conflict_sink :: _ -> (* create a trace for one of the conflicts and append it to the trace for the original sink *) let conflict_trace = make_trace_for_sink conflict_sink in + let get_start_loc = function + | head :: _ -> head.Errlog.lt_loc + | [] -> Location.dummy in let first_trace_spacer = - Errlog.make_trace_element 0 Location.dummy "" [] in + Errlog.make_trace_element + 0 (get_start_loc original_trace) "" [] in let second_trace_spacer = - Errlog.make_trace_element 0 Location.dummy "" [] in + Errlog.make_trace_element + 0 (get_start_loc conflict_trace) "" [] in (first_trace_spacer :: original_trace) @ (second_trace_spacer :: conflict_trace) | [] -> original_trace