Skip to content

Commit

Permalink
duparray
Browse files Browse the repository at this point in the history
  • Loading branch information
chambart committed Oct 9, 2024
1 parent 563123f commit 04adea2
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions wasm/runtime.wat
Original file line number Diff line number Diff line change
Expand Up @@ -170,28 +170,21 @@
)

(func (export "duparray") (param $src (ref eq)) (result (ref eq))
(local $a (ref null $Array)) (local $dst (ref null $Array))

unreachable
(;
(local $a (ref $Array))
(local $dst (ref $Array))
(local.set $a (ref.cast (ref $Array) (local.get $src)))
(local.set $dst
(array.new $Array
(ref.null eq)
(ref.i31 (i32.const 42))
(array.len (local.get $a))))
(array.copy $Array $Array
(local.get $a)
(i32.const 0)
(local.get $dst)
(i32.const 0)
(array.len (local.get $a))
)
local.get $dst
ref.as_non_null
;)
(local.get $dst)
)

;; ============
Expand Down

0 comments on commit 04adea2

Please sign in to comment.