Commit 4007378d authored by Jakob Kummerow's avatar Jakob Kummerow Committed by Commit Bot

[ubsan] Turn on full -fsanitize=undefined

The build config inherited from Chromium only enables a subset
of the checks that UBSan supports. We want them all, so this
patch overrides what "is_ubsan" means for V8.

Bug: v8:3770
Change-Id: I1d0a7d994279272f13ff1d4ac9ed235fcbfc0951
Reviewed-on: https://chromium-review.googlesource.com/c/1443502
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: 's avatarMichael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59222}
parent 6e03d7ee
...@@ -656,6 +656,11 @@ config("toolchain") { ...@@ -656,6 +656,11 @@ config("toolchain") {
"-Wno-return-type", "-Wno-return-type",
] ]
} }
# Chromium uses a hand-picked subset of UBSan coverage. We want everything.
if (is_ubsan) {
cflags += [ "-fsanitize=undefined" ]
}
} }
# Configs for code coverage with gcov. Separate configs for cflags and ldflags # Configs for code coverage with gcov. Separate configs for cflags and ldflags
......
...@@ -72,7 +72,10 @@ bool InterpretWasmModuleForTesting(Isolate* isolate, ...@@ -72,7 +72,10 @@ bool InterpretWasmModuleForTesting(Isolate* isolate,
size_t param_count = signature->parameter_count(); size_t param_count = signature->parameter_count();
std::unique_ptr<WasmValue[]> arguments(new WasmValue[param_count]); std::unique_ptr<WasmValue[]> arguments(new WasmValue[param_count]);
memcpy(arguments.get(), args, std::min(param_count, argc)); size_t arg_count = std::min(param_count, argc);
if (arg_count > 0) {
memcpy(arguments.get(), args, arg_count);
}
// Fill the parameters up with default values. // Fill the parameters up with default values.
for (size_t i = argc; i < param_count; ++i) { for (size_t i = argc; i < param_count; ++i) {
......
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