Commit 1fa8b3e8 authored by Clemens Backes's avatar Clemens Backes Committed by V8 LUCI CQ

[wasm] Unify bounds checks in tests and production

The {TestingModuleBuilder} had separate logic to compute the bounds
checking strategy. This can lead to compiled code that does not match
the bounds checking strategy stored in the NativeModule. Hence, tests
should use {NativeModule::bounds_checks_} for initializing their
compilation environment.

R=ahaas@chromium.org

Change-Id: I366c2ea5d06062273fa21e388871fc1adab54fef
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3009222Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75601}
parent 2f50d30f
......@@ -313,12 +313,7 @@ uint32_t TestingModuleBuilder::AddPassiveElementSegment(
}
CompilationEnv TestingModuleBuilder::CreateCompilationEnv() {
// This is a hack so we don't need to call
// trap_handler::IsTrapHandlerEnabled().
const bool use_trap_handler =
V8_TRAP_HANDLER_SUPPORTED && !i::FLAG_wasm_enforce_bounds_checks;
return {test_module_.get(),
use_trap_handler ? kTrapHandler : kExplicitBoundsChecks,
return {test_module_.get(), native_module_->bounds_checks(),
runtime_exception_support_, enabled_features_};
}
......
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