aboutsummaryrefslogtreecommitdiff
path: root/kernel/cbytegen.ml
diff options
context:
space:
mode:
authorPierre-Marie Pédrot2018-07-23 17:59:30 +0200
committerPierre-Marie Pédrot2018-07-24 14:43:31 +0200
commit2ff9efcf617318fdfec9966cf3690d1fc4e56da7 (patch)
treec350fe3b3004bc37335da704efce2f83cb0f5ddd /kernel/cbytegen.ml
parentcb15de5ec1a8a9092a2d44fde9f98a642b9330a6 (diff)
Fix #8119: anomalies in vm_compute with let and evars.
There were actually two broken things with VM + evars, the fixes are: - Do not pass let-bound arguments to evars. - Use the right order for evar arguments. Native compilation seems to be suffering from the same shortcomings, I will open a separate bug and adapt the PR.
Diffstat (limited to 'kernel/cbytegen.ml')
-rw-r--r--kernel/cbytegen.ml3
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/cbytegen.ml b/kernel/cbytegen.ml
index 6677db2fd9..981444ac5e 100644
--- a/kernel/cbytegen.ml
+++ b/kernel/cbytegen.ml
@@ -501,6 +501,9 @@ let rec compile_lam env cenv lam sz cont =
if Array.is_empty args then
compile_fv_elem cenv (FVevar evk) sz cont
else
+ (** Arguments are reversed in evar instances *)
+ let args = Array.copy args in
+ let () = Array.rev args in
comp_app compile_fv_elem (compile_lam env) cenv (FVevar evk) args sz cont
| Lconst (kn,u) -> compile_constant env cenv kn u [||] sz cont