aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--contrib/extraction/mlutil.ml4
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/extraction/mlutil.ml b/contrib/extraction/mlutil.ml
index 3c151fac9b..2a80227f1f 100644
--- a/contrib/extraction/mlutil.ml
+++ b/contrib/extraction/mlutil.ml
@@ -496,8 +496,8 @@ let gen_subst v d t =
| MLrel i as a ->
let i'= i-n in
if i' < 1 then a
- else if i' < Array.length v then
- ast_lift n v.(i')
+ else if i' <= Array.length v then
+ ast_lift n v.(i'-1)
else MLrel (i+d)
| a -> ast_map_lift subst n a
in subst 0 t