aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGaëtan Gilbert2019-10-13 22:51:29 +0200
committerGaëtan Gilbert2019-10-14 11:34:37 +0200
commitc6506c9276a9c38557d523224148fe2b9d98dafa (patch)
tree55c791c0bf14b4ad070661a7e889498360e37968
parent81216e8947fb4906f5a2b109cbed3e2584383c57 (diff)
Fix #9851: anomaly when unsolved evar in Add Ring
AFAICT there is no reason to use interp_open_constr I used Evd.from_ctx to keep passing evar maps around but maybe we should be passing ustates instead?
-rw-r--r--plugins/setoid_ring/newring.ml4
-rw-r--r--test-suite/bugs/closed/bug_9851.v18
2 files changed, 20 insertions, 2 deletions
diff --git a/plugins/setoid_ring/newring.ml b/plugins/setoid_ring/newring.ml
index 76c393450b..e3e787df2c 100644
--- a/plugins/setoid_ring/newring.ml
+++ b/plugins/setoid_ring/newring.ml
@@ -139,8 +139,8 @@ let _ = add_tacdef false ((Loc.ghost,Id.of_string"ring_closed_term"
let ic c =
let env = Global.env() in
let sigma = Evd.from_env env in
- let sigma, c = Constrintern.interp_open_constr env sigma c in
- (sigma, c)
+ let c, uctx = Constrintern.interp_constr env sigma c in
+ (Evd.from_ctx uctx, c)
let ic_unsafe c = (*FIXME remove *)
let env = Global.env() in
diff --git a/test-suite/bugs/closed/bug_9851.v b/test-suite/bugs/closed/bug_9851.v
new file mode 100644
index 0000000000..1f57ce8471
--- /dev/null
+++ b/test-suite/bugs/closed/bug_9851.v
@@ -0,0 +1,18 @@
+Require Import Ring_base.
+Record word : Type := Build_word
+ { rep : Type;
+ zero : rep; one: rep;
+ add : rep -> rep -> rep;
+ sub : rep -> rep -> rep;
+ opp : rep -> rep;
+ mul : rep -> rep -> rep;
+ }.
+Axiom rth
+ : forall (word : word ),
+ @ring_theory (@rep word)
+ (@zero word)
+ (@one word) (@add word)
+ (@mul word) (@sub word)
+ (@opp word) (@eq (@rep word)).
+
+Fail Add Ring wring: (@rth _).