Commit 140c1e51 authored by Ben Smith's avatar Ben Smith Committed by Commit Bot

[wasm] Disable asan for memory_fill_wrapper

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/+/1590386Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Commit-Queue: Ben Smith <binji@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61223}
parent 82193234
......@@ -278,7 +278,11 @@ DISABLE_ASAN void memory_copy_wrapper(Address dst, Address src, uint32_t size) {
}
}
void memory_fill_wrapper(Address dst, uint32_t value, uint32_t size) {
// Asan on Windows triggers exceptions in this function that confuse the
// WebAssembly trap handler, so Asan is disabled. See the comment on
// memory_copy_wrapper above for more info.
DISABLE_ASAN void memory_fill_wrapper(Address dst, uint32_t value,
uint32_t size) {
// Use an explicit forward copy to match the required semantics for the
// memory.fill instruction. It is assumed that the caller of this function
// has already performed bounds checks, so {dst + size} should not overflow.
......
// 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));
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