Commit 7da1a952 authored by Ng Zhi An's avatar Ng Zhi An Committed by Commit Bot

[wasm-simd] Add OOB tests for v128 load zero

Bug: v8:10713
Change-Id: I7b123347e00f31d071d45e3b807354610b71ed2d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2486238Reviewed-by: 's avatarBill Budge <bbudge@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70667}
parent 83348261
......@@ -3720,6 +3720,22 @@ void RunLoadZeroTest(TestExecutionTier execution_tier, LowerSimd lower_simd,
for (int i = 1; i < lanes_s; i++) {
CHECK_EQ(S{0}, ReadLittleEndianValue<S>(&global[i]));
}
// Test for OOB.
{
WasmRunner<int32_t, uint32_t> r(execution_tier, lower_simd);
r.builder().AddMemoryElems<S>(kWasmPageSize / sizeof(S));
r.builder().AddGlobal<S>(kWasmS128);
BUILD(r, WASM_SET_GLOBAL(0, WASM_SIMD_LOAD_OP(op, WASM_GET_LOCAL(0))),
WASM_ONE);
// Load extends load sizeof(S) bytes.
for (uint32_t offset = kWasmPageSize - (sizeof(S) - 1);
offset < kWasmPageSize; ++offset) {
CHECK_TRAP(r.Call(offset));
}
}
}
WASM_SIMD_TEST_NO_LOWERING(S128Load32Zero) {
......
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