Skip to content

Commit

Permalink
Merge pull request #3374 from mtzguido/idinfo
Browse files Browse the repository at this point in the history
Tactics: restoring ID info table on a failure
  • Loading branch information
mtzguido authored Aug 14, 2024
2 parents 608c8c2 + 50ed7b8 commit 8a208d6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ocaml/fstar-lib/generated/FStar_Tactics_Monad.ml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/tactics/FStar.Tactics.Monad.fst
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,15 @@ let fail msg = fail_doc [text msg]

let catch (t : tac 'a) : tac (either exn 'a) =
mk_tac (fun ps ->
let idtable = !ps.main_context.identifier_info in
let tx = UF.new_transaction () in
match run t ps with
| Success (a, q) ->
UF.commit tx;
Success (Inr a, q)
| Failed (m, q) ->
UF.rollback tx;
ps.main_context.identifier_info := idtable;
let ps = { ps with freshness = q.freshness } in //propagate the freshness even on failures
Success (Inl m, ps)
)
Expand Down

0 comments on commit 8a208d6

Please sign in to comment.