aboutsummaryrefslogtreecommitdiff
path: root/pretyping
diff options
context:
space:
mode:
authorletouzey2013-03-20 17:01:03 +0000
committerletouzey2013-03-20 17:01:03 +0000
commit4d060e768ced36ad915daf8e651191a06a802bb3 (patch)
treefee2d0b8de119972f573a4685e92a171143fa225 /pretyping
parentf5afee34bdf667ef1987df943fc9aec41dcb90bc (diff)
Check a list length before doing a List.chop (fix #3000)
I'm not completely sure that raising Not_found is the right thing to do here, but it seems reasonable... git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@16326 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'pretyping')
-rw-r--r--pretyping/inductiveops.ml1
1 files changed, 1 insertions, 0 deletions
diff --git a/pretyping/inductiveops.ml b/pretyping/inductiveops.ml
index 0017fee788..ef95fbb5c8 100644
--- a/pretyping/inductiveops.ml
+++ b/pretyping/inductiveops.ml
@@ -327,6 +327,7 @@ let find_rectype env sigma c =
match kind_of_term t with
| Ind ind ->
let (mib,mip) = Inductive.lookup_mind_specif env ind in
+ if mib.mind_nparams > List.length l then raise Not_found;
let (par,rargs) = List.chop mib.mind_nparams l in
IndType((ind, par),rargs)
| _ -> raise Not_found