Skip to content

Commit 4e12edd

Browse files
gahaasCommit Bot
authored and
Commit Bot
committed
[wasm] Introduce <bot> type for unreachable br_table again
This CL implements the spec change done in WebAssembly/reference-types#116. [email protected] Bug: v8:10994 Change-Id: Ic2b4e0a52af225b5640447fe051a9c36e6d41be2 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2534818 Commit-Queue: Andreas Haas <[email protected]> Reviewed-by: Manos Koukoutos <[email protected]> Cr-Commit-Position: refs/heads/master@{#71260}
1 parent c5d998a commit 4e12edd

File tree

3 files changed

+2
-12
lines changed

3 files changed

+2
-12
lines changed

src/wasm/function-body-decoder-impl.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3407,17 +3407,8 @@ class WasmFullDecoder : public WasmDecoder<validate> {
34073407
for (int i = 0; i < br_arity; ++i) {
34083408
if (this->enabled_.has_reftypes()) {
34093409
// The expected type is the biggest common sub type of all targets.
3410-
ValueType type = (*result_types)[i];
34113410
(*result_types)[i] =
34123411
CommonSubtype((*result_types)[i], (*merge)[i].type, this->module_);
3413-
if (!VALIDATE((*result_types)[i] != kWasmBottom)) {
3414-
this->DecodeError(pos,
3415-
"inconsistent type in br_table target %u (previous "
3416-
"was %s, this one is %s)",
3417-
index, type.name().c_str(),
3418-
(*merge)[i].type.name().c_str());
3419-
return false;
3420-
}
34213412
} else {
34223413
// All target must have the same signature.
34233414
if (!VALIDATE((*result_types)[i] == (*merge)[i].type)) {

test/mjsunit/regress/wasm/regress-1046472.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,5 @@ kExprEnd, // @21
2929
assertThrows(
3030
() => {builder.toModule()}, WebAssembly.CompileError,
3131
'WebAssembly.Module(): Compiling function #0:\"main\" failed: ' +
32-
'inconsistent type in br_table target 1 (previous was i32, ' +
33-
'this one is f32) @+60');
32+
'type error in merge[0] (expected <bot>, got i32) @+57');
3433
})();

test/wasm-spec-tests/wasm-spec-tests.status

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
'binary': [FAIL],
1010
'proposals/bulk-memory-operations/binary': [FAIL],
1111
# TODO(v8:10994): Failing spec test after update.
12-
'proposals/reference-types/br_table': [FAIL],
1312
'proposals/simd/binary': [FAIL],
1413
'proposals/simd/data': [FAIL],
1514
'proposals/js-types/data': [FAIL],
@@ -36,6 +35,7 @@
3635
'proposals/tail-call/imports': [FAIL],
3736
'proposals/tail-call/linking': [FAIL],
3837
'proposals/tail-call/type': [FAIL],
38+
'proposals/tail-call/unreached-invalid': [FAIL],
3939

4040
# This test requires the reftypes flag to be disabled.
4141
'proposals/bulk-memory-operations/imports': [FAIL],

0 commit comments

Comments
 (0)