aboutsummaryrefslogtreecommitdiff
path: root/kernel/nativeconv.ml
diff options
context:
space:
mode:
authorPierre-Marie Pédrot2020-07-06 16:18:33 +0200
committerPierre-Marie Pédrot2020-07-06 16:18:33 +0200
commit8907a5b7d2b91bff0b573956a05e4679b5238161 (patch)
tree2fff532e687a8e82543044352aeaf3168434aac1 /kernel/nativeconv.ml
parent3244b9c6e4159042bae0cd2ad48aba77928d7b2d (diff)
parent0ea2d0ff4ed84e1cc544c958b8f6e98f6ba2e9b6 (diff)
Merge PR #11604: Primitive persistent arrays
Ack-by: JasonGross Ack-by: SkySkimmer Ack-by: ejgallego Ack-by: gares Reviewed-by: ppedrot Ack-by: proux01 Ack-by: silene
Diffstat (limited to 'kernel/nativeconv.ml')
-rw-r--r--kernel/nativeconv.ml6
1 files changed, 5 insertions, 1 deletions
diff --git a/kernel/nativeconv.ml b/kernel/nativeconv.ml
index 31a716a786..01e9550ec5 100644
--- a/kernel/nativeconv.ml
+++ b/kernel/nativeconv.ml
@@ -38,6 +38,10 @@ let rec conv_val env pb lvl v1 v2 cu =
| Vfloat64 f1, Vfloat64 f2 ->
if Float64.(equal (of_float f1) (of_float f2)) then cu
else raise NotConvertible
+ | Varray t1, Varray t2 ->
+ let len = Parray.length_int t1 in
+ if not (Int.equal len (Parray.length_int t2)) then raise NotConvertible;
+ Parray.fold_left2 (fun cu v1 v2 -> conv_val env CONV lvl v1 v2 cu) cu t1 t2
| Vblock b1, Vblock b2 ->
let n1 = block_size b1 in
let n2 = block_size b2 in
@@ -51,7 +55,7 @@ let rec conv_val env pb lvl v1 v2 cu =
aux lvl max b1 b2 (i+1) cu
in
aux lvl (n1-1) b1 b2 0 cu
- | (Vaccu _ | Vconst _ | Vint64 _ | Vfloat64 _ | Vblock _), _ -> raise NotConvertible
+ | (Vaccu _ | Vconst _ | Vint64 _ | Vfloat64 _ | Varray _ | Vblock _), _ -> raise NotConvertible
and conv_accu env pb lvl k1 k2 cu =
let n1 = accu_nargs k1 in