Skip to content

Commit b4ece7a

Browse files
vouillonhhugo
authored andcommitted
Wasm runtime: fix caml_floatarray_concat
1 parent 8787cb7 commit b4ece7a

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

runtime/wasm/array.wat

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@
315315
(br $fill))))
316316
(local.get $a))))
317317

318-
(func (export "caml_float_array_concat") (param (ref eq)) (result (ref eq))
318+
(func (export "caml_floatarray_concat") (param (ref eq)) (result (ref eq))
319319
(local $i i32) (local $len i32)
320320
(local $l (ref eq)) (local $v (ref eq))
321321
(local $b (ref $block))
@@ -327,9 +327,12 @@
327327
(local.set $b
328328
(br_on_cast_fail $exit (ref eq) (ref $block) (local.get $l)))
329329
(local.set $v (array.get $block (local.get $b) (i32.const 1)))
330-
(local.set $len
331-
(i32.add (local.get $len)
332-
(array.len (ref.cast (ref $float_array) (local.get $v)))))
330+
(if (ref.test (ref $float_array) (local.get $v))
331+
(then
332+
(local.set $len
333+
(i32.add (local.get $len)
334+
(array.len
335+
(ref.cast (ref $float_array) (local.get $v)))))))
333336
(local.set $l (array.get $block (local.get $b) (i32.const 2)))
334337
(br $compute_length))))
335338
(local.set $fa

0 commit comments

Comments
 (0)