Skip to content

Commit d6cef91

Browse files
committed
Unify current_loc with backtrace marks for global initializers
1 parent b577ec1 commit d6cef91

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/framework/control.ml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,6 @@ struct
321321
if M.tracing then M.trace "con" "Initializer %a" CilType.Location.pretty loc;
322322
(*incr count;
323323
if (get_bool "dbg.verbose")&& (!count mod 1000 = 0) then Printf.printf "%d %!" !count; *)
324-
Goblint_tracing.current_loc := loc;
325324
match edge with
326325
| MyCFG.Entry func ->
327326
if M.tracing then M.trace "global_inits" "Entry %a" d_lval (var func.svar);
@@ -342,17 +341,18 @@ struct
342341
| _ -> failwith "Unsupported global initializer edge"
343342
in
344343
let transfer_func st (loc, edge) =
344+
let old_loc = !Goblint_tracing.current_loc in
345+
Goblint_tracing.current_loc := loc;
346+
(* TODO: next_loc? *)
345347
Goblint_backtrace.protect ~mark:(fun () -> Constraints.TfLocation loc) ~finally:(fun () ->
346-
()
348+
Goblint_tracing.current_loc := old_loc;
347349
) (fun () ->
348350
transfer_func st (loc, edge)
349351
)
350352
in
351353
let with_externs = do_extern_inits man file in
352354
(*if (get_bool "dbg.verbose") then Printf.printf "Number of init. edges : %d\nWorking:" (List.length edges); *)
353-
let old_loc = !Goblint_tracing.current_loc in
354355
let result : Spec.D.t = List.fold_left transfer_func with_externs edges in
355-
Goblint_tracing.current_loc := old_loc;
356356
if M.tracing then M.trace "global_inits" "startstate: %a" Spec.D.pretty result;
357357
result, !funs
358358
in

0 commit comments

Comments
 (0)