aboutsummaryrefslogtreecommitdiff
path: root/kernel/reduction.ml
diff options
context:
space:
mode:
authorbarras2006-05-03 12:02:44 +0000
committerbarras2006-05-03 12:02:44 +0000
commita9df5940e0b362f627abf500e056e197e403c8e1 (patch)
tree81e6aad40d9343085f3d5acdeb719a4fd11e1858 /kernel/reduction.ml
parentc599e13efd9e7b00c39d5a3812d8360124257f4b (diff)
bug #1096: whd_stack on one arg of conversion had side-effect on the other arg
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@8782 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'kernel/reduction.ml')
-rw-r--r--kernel/reduction.ml16
1 files changed, 12 insertions, 4 deletions
diff --git a/kernel/reduction.ml b/kernel/reduction.ml
index 2467e941fb..4aa7c57539 100644
--- a/kernel/reduction.ml
+++ b/kernel/reduction.ml
@@ -291,10 +291,18 @@ and eqappr cv_pb infos appr1 appr2 cuniv =
convert_stacks infos lft1 lft2 v1 v2 u2
else raise NotConvertible
- | ( (FLetIn _, _) | (_, FLetIn _) | (FCases _,_) | (_,FCases _)
- | (FApp _,_) | (_,FApp _) | (FCLOS _, _) | (_,FCLOS _)
- | (FLIFT _, _) | (_,FLIFT _) | (FLOCKED,_) | (_,FLOCKED)) ->
- anomaly "Unexpected term returned by fhnf"
+ (* Can happen because whd_stack on one arg may have side-effects
+ on the other arg and coulb be no more in hnf... *)
+ | ( (FLetIn _, _) | (FCases _,_) | (FApp _,_)
+ | (FCLOS _, _) | (FLIFT _, _)) ->
+ eqappr cv_pb infos (lft1, whd_stack infos hd1 v1) appr2 cuniv
+
+ | ( (_, FLetIn _) | (_,FCases _) | (_,FApp _)
+ | (_,FCLOS _) | (_,FLIFT _)) ->
+ eqappr cv_pb infos (lft1, whd_stack infos hd1 v1) appr2 cuniv
+
+ (* Should not happen because whd_stack unlocks references *)
+ | ((FLOCKED,_) | (_,FLOCKED)) -> assert false
| _ -> raise NotConvertible