From e49ecf90e565b9e49f114cadb6b24ab660cd02f3 Mon Sep 17 00:00:00 2001 From: Gaƫtan Gilbert Date: Fri, 7 Jun 2019 15:42:39 +0200 Subject: Fix #9455: avoid update_global_env when unchanged Global.universes() This also makes vernacentries correct wrt update_global_env. --- vernac/vernacentries.ml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'vernac') diff --git a/vernac/vernacentries.ml b/vernac/vernacentries.ml index d206165e88..d52fe480ef 100644 --- a/vernac/vernacentries.ml +++ b/vernac/vernacentries.ml @@ -2755,7 +2755,10 @@ and vernac_load ~verbosely ~st 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 -- cgit v1.2.3