Skip to content

Commit

Permalink
Merge pull request #475 from hacspec/fix-leaking-errors
Browse files Browse the repository at this point in the history
fix(engine/import-thir): fix leaking errors
  • Loading branch information
W95Psp authored Jan 30, 2024
2 parents bd6c328 + b3dcb1e commit bc9e452
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion engine/lib/diagnostics.ml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,11 @@ end = struct

let capture (type a) (f : unit -> a) : a * t list =
let previous_state = !state in
let result = (f (), !state) in
state := [];
let result =
let x = f () in
(x, !state)
in
state := previous_state;
result
end
Expand Down

0 comments on commit bc9e452

Please sign in to comment.