From 363706285e6fb257e6298b33904316c3fdef7222 Mon Sep 17 00:00:00 2001 From: letouzey Date: Mon, 24 Oct 2011 23:24:43 +0000 Subject: 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 --- library/heads.ml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'library') 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 -- cgit v1.2.3