Commit 71ed79be authored by Clemens Backes's avatar Clemens Backes Committed by V8 LUCI CQ

[wasm] Add regression test for 1314184

The fix is merged to all channels, add the regression test.

R=thibaudm@chromium.org

Bug: chromium:1314184
Change-Id: I7b7ca13ff34b19c3dbb727d248619dc1ff874873
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3596161Reviewed-by: 's avatarThibaud Michaud <thibaudm@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#80044}
parent c31da024
// Copyright 2022 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
d8.file.execute('test/mjsunit/wasm/wasm-module-builder.js');
const builder = new WasmModuleBuilder();
builder.addMemory(16, 32, false);
builder.addFunction('main', kSig_i_iii)
.addBodyWithEnd([
kExprI32Const, 0x0, // i32.const
kExprMemorySize, 0, // memory.size
kExprI32Popcnt, // i32.popcnt
kExprI32Const, 0, // i32.const
kExprMemoryGrow, 0, // memory.grow
kExprI32GeU, // i32.ge_u
kExprBrIf, 0, // br_if depth=0
kExprMemorySize, 0, // memory.size
kExprUnreachable, // unreachable
kExprEnd, // end
])
.exportFunc();
const instance = builder.instantiate();
assertTraps(kExprUnreachable, () => instance.exports.main(1, 2, 3));
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment