Skip to content

Commit

Permalink
Reinitializing current path to avoid double replay
Browse files Browse the repository at this point in the history
  • Loading branch information
Stevendeo committed Apr 5, 2024
1 parent baba255 commit e02c791
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/bin/common/solving_loop.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1174,7 +1174,6 @@ let main () =

(* TODO: reset options to their initial value. *)
let handle_reset st =
let () = Steps.reset_steps () in
st
|> State.set partial_model_key None
|> State.set solver_ctx_key empty_solver_ctx
Expand Down Expand Up @@ -1408,6 +1407,8 @@ let main () =
in
let rev_prefix = pop_until (n - 1) (Vec.pop pushed_paths) in
let st = handle_reset st in
(* Part of the reset, the current path must be reinitialized as well. *)
let st = State.set current_path_key [] st in
replay st (List.rev rev_prefix)
in

Expand Down
2 changes: 2 additions & 0 deletions src/lib/frontend/d_state_option.ml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ let create_opt
st
|> apply_hooks ~old ~new_
|> State.update_opt key (fun _ -> None)
(* S: [clear] rebuilds a new default value for the hooks, but does not put
it back on the state. *)

let reset_hooks () = on_update_list := on_update_base

Expand Down

0 comments on commit e02c791

Please sign in to comment.