aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmilio Jesus Gallego Arias2019-07-03 13:02:55 +0200
committerEmilio Jesus Gallego Arias2019-07-03 13:02:55 +0200
commit465ee008d15bb1fb0428aef513b8c3fd3456327a (patch)
treedfc870d1a5d7b6d50adbd25e805f9521143a10a0
parent60a13c4f6f9ce211a4078634e66d5eae49035ccc (diff)
parente49ecf90e565b9e49f114cadb6b24ab660cd02f3 (diff)
Merge PR #10338: Fix #9455: avoid update_global_env when unchanged Global.universes()
Ack-by: SkySkimmer Reviewed-by: ejgallego Ack-by: gares
-rw-r--r--stm/stm.ml9
-rw-r--r--vernac/vernacentries.ml5
2 files changed, 7 insertions, 7 deletions
diff --git a/stm/stm.ml b/stm/stm.ml
index e04277b052..ceb62582cd 100644
--- a/stm/stm.ml
+++ b/stm/stm.ml
@@ -2423,8 +2423,7 @@ let known_state ~doc ?(redefine_qed=false) ~cache id =
(* State resulting from reach *)
let st = Vernacstate.freeze_interp_state ~marshallable:false in
ignore(stm_vernac_interp id st x)
- );
- if eff then update_global_env ()
+ )
), eff || cache, true
| `Cmd { cast = x; ceff = eff } -> (fun () ->
(match !cur_opt.async_proofs_mode with
@@ -2432,8 +2431,7 @@ let known_state ~doc ?(redefine_qed=false) ~cache id =
resilient_command reach view.next
| APoff -> reach view.next);
let st = Vernacstate.freeze_interp_state ~marshallable:false in
- ignore(stm_vernac_interp id st x);
- if eff then update_global_env ()
+ ignore(stm_vernac_interp id st x)
), eff || cache, true
| `Fork ((x,_,_,_), None) -> (fun () ->
resilient_command reach view.next;
@@ -2562,8 +2560,7 @@ let known_state ~doc ?(redefine_qed=false) ~cache id =
| `Sideff (ReplayCommand x,_) -> (fun () ->
reach view.next;
let st = Vernacstate.freeze_interp_state ~marshallable:false in
- ignore(stm_vernac_interp id st x);
- update_global_env ()
+ ignore(stm_vernac_interp id st x)
), cache, true
| `Sideff (CherryPickEnv, origin) -> (fun () ->
reach view.next;
diff --git a/vernac/vernacentries.ml b/vernac/vernacentries.ml
index 2d48af6a8e..793ba72fd3 100644
--- a/vernac/vernacentries.ml
+++ b/vernac/vernacentries.ml
@@ -2681,7 +2681,10 @@ and vernac_load ~verbosely fname =
and interp_control ?proof ~st v = match v with
| { v=VernacExpr (atts, cmd) } ->
- interp_expr ?proof ~atts ~st cmd
+ let before_univs = Global.universes () in
+ let pstack = interp_expr ?proof ~atts ~st cmd in
+ if before_univs == Global.universes () then pstack
+ else Option.map (Lemmas.Stack.map_top_pstate ~f:Proof_global.update_global_env) pstack
| { v=VernacFail v } ->
with_fail ~st (fun () -> interp_control ?proof ~st v);
st.Vernacstate.lemmas