From ca0d97dd3b3033e7f87dd5e5ea09ab6f14fd881b Mon Sep 17 00:00:00 2001 From: Maxime Dénès Date: Tue, 4 Apr 2017 10:41:18 +0200 Subject: Fix bug #5435: [Eval native_compute in] raises anomaly. Was introduced by 4f041384cb27f0d2. Unsoundness seems miraculously avoided by a safeguard I put in nativecode.ml. But other kernel changes in this commit should probably be reviewed carefully. --- kernel/nativecode.ml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'kernel/nativecode.ml') diff --git a/kernel/nativecode.ml b/kernel/nativecode.ml index eaddace4b..b17715a8f 100644 --- a/kernel/nativecode.ml +++ b/kernel/nativecode.ml @@ -1849,9 +1849,10 @@ and apply_fv env sigma univ (fv_named,fv_rel) auxdefs ml = and compile_rel env sigma univ auxdefs n = let open Context.Rel in - let n = length env.env_rel_context - n in let open Declaration in - match lookup n env.env_rel_context with + let decl = lookup n env.env_rel_context in + let n = 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 -- cgit v1.2.3