Commit e92fb6e4 authored by Andreas Haas's avatar Andreas Haas Committed by Commit Bot

[wasm] Passive element segments don't need a table

This CL fixes a spec violation that new spec tests uncovered.

R=thibaudm@chromium.org
CC=ecmziegler@chromium.org

Change-Id: Ie8ae455117f1c719815bad78f14c3b2c5e404e79
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2122023
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Reviewed-by: 's avatarThibaud Michaud <thibaudm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66885}
parent a07dd510
...@@ -1841,9 +1841,6 @@ class ModuleDecoderImpl : public Decoder { ...@@ -1841,9 +1841,6 @@ class ModuleDecoderImpl : public Decoder {
*status = WasmElemSegment::kStatusDeclarative; *status = WasmElemSegment::kStatusDeclarative;
} else { } else {
*status = WasmElemSegment::kStatusPassive; *status = WasmElemSegment::kStatusPassive;
if (module_->tables.size() == 0) {
error(pc_, "Passive element sections require a table");
}
} }
*functions_as_elements = flag & kFunctionsAsElementsMask; *functions_as_elements = flag & kFunctionsAsElementsMask;
bool has_table_index = (flag & kHasTableIndexMask) && bool has_table_index = (flag & kHasTableIndexMask) &&
......
...@@ -222,3 +222,12 @@ function getMemoryFill(mem) { ...@@ -222,3 +222,12 @@ function getMemoryFill(mem) {
// Should not throw. // Should not throw.
builder.instantiate(); builder.instantiate();
})(); })();
(function TestPassiveElementSegmentNoMemory() {
const builder = new WasmModuleBuilder();
builder.addFunction('f', kSig_v_v).addBody([]);
builder.addPassiveElementSegment([0, 0, 0]);
// Should not throw.
builder.instantiate();
})();
...@@ -24,8 +24,6 @@ ...@@ -24,8 +24,6 @@
'proposals/multi-value/call': [FAIL], 'proposals/multi-value/call': [FAIL],
'proposals/multi-value/if': [FAIL], 'proposals/multi-value/if': [FAIL],
'proposals/multi-value/func': [FAIL], 'proposals/multi-value/func': [FAIL],
'proposals/bulk-memory-operations/bulk': [FAIL],
}], # ALWAYS }], # ALWAYS
['arch == mipsel or arch == mips64el or arch == mips or arch == mips64', { ['arch == mipsel or arch == mips64el or arch == mips or arch == mips64', {
......
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