Skip to content

A lightweight WebAssembly runtime that is fast, secure, and standards-compliant

342 B
Raw Blame
;;! gc = true
;;! flags = "-O gc-heap-may-move=n"

(module
  (type $a (array (mut i8)))

  (global $g (mut (ref $a)) (array.new_default $a (i32.const 12)))

  (func (export "array-get-nth") (param $p i32) (result i32)
    (array.get_u $a (global.get $g) (local.get $p))))

(assert_return (invoke "array-get-nth" (i32.const 0)) (i32.const 0))