aboutsummaryrefslogtreecommitdiffhomepage
path: root/library
diff options
context:
space:
mode:
authorGravatar letouzey <letouzey@85f007b7-540e-0410-9357-904b9bb8a0f7>2011-10-24 23:24:43 +0000
committerGravatar letouzey <letouzey@85f007b7-540e-0410-9357-904b9bb8a0f7>2011-10-24 23:24:43 +0000
commit363706285e6fb257e6298b33904316c3fdef7222 (patch)
tree88f2aeb493cd46172edb21fbdb0a1d1dbf6e8455 /library
parent63710768d32c5929aa6498aff5aae2f9e0058e95 (diff)
Heads: avoid potentially uncaught Not_found via an assert false
The underlying issue (#2608) should be fixed now. In case something similar happens again, we won't be chasing again a Not_found here. Same idea as commit r14550, but this initial attempt was too zealous: we shouldn't also "protect" variable_head, since a Not_found in it is handled a few lines later. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@14588 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'library')
-rw-r--r--library/heads.ml4
1 files changed, 3 insertions, 1 deletions
diff --git a/library/heads.ml b/library/heads.ml
index 8fda452c1..813031558 100644
--- a/library/heads.ml
+++ b/library/heads.ml
@@ -80,7 +80,9 @@ let kind_of_head env t =
match pi2 (lookup_named id env) with
| Some c -> aux k l c b
| None -> NotImmediatelyComputableHead)
- | Const cst -> on_subterm k l b (constant_head cst)
+ | Const cst ->
+ (try on_subterm k l b (constant_head cst)
+ with Not_found -> assert false)
| Construct _ | CoFix _ ->
if b then NotImmediatelyComputableHead else ConstructorHead
| Sort _ | Ind _ | Prod _ -> RigidHead RigidType