Skip to content

[EH] Make tag attribute's encoding uint8 #3949

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 22, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/wasm/wasm-binary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ void WasmBinaryWriter::writeImports() {
BYN_TRACE("write one tag\n");
writeImportHeader(tag);
o << U32LEB(int32_t(ExternalKind::Tag));
o << U32LEB(0); // Reserved 'attribute' field. Always 0.
o << uint8_t(0); // Reserved 'attribute' field. Always 0.
o << U32LEB(getTypeIndex(tag->sig));
});
if (wasm->memory.imported()) {
Expand Down Expand Up @@ -656,7 +656,7 @@ void WasmBinaryWriter::writeTags() {
o << U32LEB(num);
ModuleUtils::iterDefinedTags(*wasm, [&](Tag* tag) {
BYN_TRACE("write one\n");
o << U32LEB(0); // Reserved 'attribute' field. Always 0.
o << uint8_t(0); // Reserved 'attribute' field. Always 0.
o << U32LEB(getTypeIndex(tag->sig));
});

Expand Down Expand Up @@ -2071,7 +2071,7 @@ void WasmBinaryBuilder::readImports() {
}
case ExternalKind::Tag: {
Name name(std::string("eimport$") + std::to_string(tagCounter++));
getU32LEB(); // Reserved 'attribute' field
getInt8(); // Reserved 'attribute' field
auto index = getU32LEB();
auto curr = builder.makeTag(name, getSignatureByTypeIndex(index));
curr->module = module;
Expand Down Expand Up @@ -2907,7 +2907,7 @@ void WasmBinaryBuilder::readTags() {
BYN_TRACE("num: " << numTags << std::endl);
for (size_t i = 0; i < numTags; i++) {
BYN_TRACE("read one\n");
getU32LEB(); // Reserved 'attribute' field
getInt8(); // Reserved 'attribute' field
auto typeIndex = getU32LEB();
wasm.addTag(Builder::makeTag("tag$" + std::to_string(i),
getSignatureByTypeIndex(typeIndex)));
Expand Down