[wasm-gc] Make table type restrictions explicit

Bug: v8:7748
Change-Id: Ib5beeb55c3a9eba8fb23680e3845f80d55f3f154
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2274633
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68646}
This commit is contained in:
Manos Koukoutos 2020-07-02 06:13:38 +00:00 committed by Commit Bot
parent 9b5971d76f
commit b72e8d5fdf

View File

@ -749,7 +749,13 @@ class ModuleDecoderImpl : public Decoder {
if (!AddTable(module_.get())) break; if (!AddTable(module_.get())) break;
module_->tables.emplace_back(); module_->tables.emplace_back();
WasmTable* table = &module_->tables.back(); WasmTable* table = &module_->tables.back();
const byte* type_position = pc();
table->type = consume_reference_type(); table->type = consume_reference_type();
if (table->type.kind() != ValueType::kOptRef) {
// TODO(7748): Implement other table types.
error(type_position,
"Currently, only nullable references are allowed as table types");
}
uint8_t flags = validate_table_flags("table elements"); uint8_t flags = validate_table_flags("table elements");
consume_resizable_limits( consume_resizable_limits(
"table elements", "elements", FLAG_wasm_max_table_size, "table elements", "elements", FLAG_wasm_max_table_size,