Bug 2038081 Comment 2 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

Here's a shell test case.
```
$ obj-shell-dbgopt/dist/bin/js --wasm-compiler=ion test.js
Assertion failure: IsValidlyAlignedDataPointer(header), at js/src/wasm/WasmGcObject.h:474
```
```js
// |jit-test| --wasm-compiler=ion
var ins = new WebAssembly.Instance(
  new WebAssembly.Module(wasmTextToBinary(`(module
    (type $s (struct (field (mut i64))))
    (type $a (array (mut (ref null $s))))
    (import "m" "hook" (func $hook))
    (func (export "run")
      (local $src (ref $a)) (local $dst (ref $a))
      (local.set $src (array.new_default $a (i32.const 15)))
      (local.set $dst (array.new_default $a (i32.const 15)))
      (array.set $a (local.get $src) (i32.const 0)
        (struct.new $s (i64.const 0x42)))
      (call $hook)
      (array.copy $a $a
        (local.get $dst) (i32.const 1)
        (local.get $src) (i32.const 0)
        (i32.const 1)))
  )`)),
  { m: { hook() { gc(this, 'shrinking'); } } }
);
ins.exports.run();
```
Here's a shell test case.
```
$ obj-shell-dbgopt/dist/bin/js --wasm-compiler=ion test.js
Assertion failure: IsValidlyAlignedDataPointer(header), at js/src/wasm/WasmGcObject.h:474
```
```js
// Run with --wasm-compiler=ion
var ins = new WebAssembly.Instance(
  new WebAssembly.Module(wasmTextToBinary(`(module
    (type $s (struct (field (mut i64))))
    (type $a (array (mut (ref null $s))))
    (import "m" "hook" (func $hook))
    (func (export "run")
      (local $src (ref $a)) (local $dst (ref $a))
      (local.set $src (array.new_default $a (i32.const 15)))
      (local.set $dst (array.new_default $a (i32.const 15)))
      (array.set $a (local.get $src) (i32.const 0)
        (struct.new $s (i64.const 0x42)))
      (call $hook)
      (array.copy $a $a
        (local.get $dst) (i32.const 1)
        (local.get $src) (i32.const 0)
        (i32.const 1)))
  )`)),
  { m: { hook() { gc(this, 'shrinking'); } } }
);
ins.exports.run();
```

Back to Bug 2038081 Comment 2