140c1e51ae
See the similar fix for memory_copy_wrapper here: https://chromium-review.googlesource.com/c/v8/v8/+/1584326 Bug: chromium:957405 Change-Id: I49e321186e40fd874f10d08e0e5a53aa225cfa19 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1590386 Reviewed-by: Andreas Haas <ahaas@chromium.org> Commit-Queue: Ben Smith <binji@chromium.org> Cr-Commit-Position: refs/heads/master@{#61223}
21 lines
779 B
JavaScript
21 lines
779 B
JavaScript
// Copyright 2019 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.
|
|
|
|
load('test/mjsunit/wasm/wasm-module-builder.js');
|
|
|
|
const memory = new WebAssembly.Memory({initial: 1});
|
|
|
|
let builder = new WasmModuleBuilder();
|
|
builder.addImportedMemory("imports", "mem");
|
|
builder.addFunction("fill", kSig_v_iii)
|
|
.addBody([kExprGetLocal, 0, // dst
|
|
kExprGetLocal, 1, // value
|
|
kExprGetLocal, 2, // size
|
|
kNumericPrefix, kExprMemoryFill, 0]).exportAs("fill");
|
|
let instance = builder.instantiate({imports: {mem: memory}});
|
|
memory.grow(1);
|
|
assertTraps(
|
|
kTrapMemOutOfBounds,
|
|
() => instance.exports.fill(kPageSize + 1, 123, kPageSize));
|