Skip to content

Commit c853560

Browse files
committed
Fix parsing of table imports
1 parent 47bcca6 commit c853560

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/wasm/wasm-s-parser.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3737,6 +3737,11 @@ void SExpressionWasmBuilder::parseImport(Element& s) {
37373737
table->max = Table::kUnlimitedSize;
37383738
}
37393739

3740+
table->type = elementToType(*inner[j++]);
3741+
if (!table->type.isRef()) {
3742+
throw SParseException("Only reference types are valid for tables", s);
3743+
}
3744+
37403745
wasm.addTable(std::move(table));
37413746

37423747
j++; // funcref

0 commit comments

Comments
 (0)