aboutsummaryrefslogtreecommitdiffhomepage
path: root/kernel
diff options
context:
space:
mode:
authorGravatar Maxime Dénès <mail@maximedenes.fr>2017-04-15 12:15:13 +0200
committerGravatar Maxime Dénès <mail@maximedenes.fr>2017-04-15 12:15:13 +0200
commit0147ae6ba6db24d4f9b29ff477d374a6abb103dd (patch)
treeb07f2d41760b7c138fc7b7b6a652320e5169e4f3 /kernel
parented09fccb6405fb832cab867919cc4b0be32dea36 (diff)
parent727ef1bd345f9ad9e08d9e4f136e2db7d034a93d (diff)
Merge branch 'v8.6' into trunk
Diffstat (limited to 'kernel')
-rw-r--r--kernel/nativecode.ml5
1 files changed, 3 insertions, 2 deletions
diff --git a/kernel/nativecode.ml b/kernel/nativecode.ml
index 33bd7d8dd..d9659d681 100644
--- a/kernel/nativecode.ml
+++ b/kernel/nativecode.ml
@@ -1848,9 +1848,10 @@ and apply_fv env sigma univ (fv_named,fv_rel) auxdefs ml =
auxdefs, MLlet(aux_name, ml, mkMLapp (MLlocal aux_name) (Array.of_list (fv_rel@fv_named)))
and compile_rel env sigma univ auxdefs n =
- let n = Context.Rel.length env.env_rel_context - n in
let open Context.Rel.Declaration in
- match Context.Rel.lookup n env.env_rel_context with
+ let decl = Context.Rel.lookup n env.env_rel_context in
+ let n = Context.Rel.length env.env_rel_context - n in
+ match decl with
| LocalDef (_,t,_) ->
let code = lambda_of_constr env sigma t in
let auxdefs,code = compile_with_fv env sigma univ auxdefs None code in