Skip to content

Implement type imports and exports #7330

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

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
format
  • Loading branch information
vouillon committed Mar 14, 2025
commit aa1e4aeb23816aeafae9059d2159a96e01a2a5c8
42 changes: 21 additions & 21 deletions src/wasm/wasm-binary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ void WasmBinaryWriter::writeExports() {
case ExternalKind::Tag:
o << U32LEB(getTagIndex(*curr->getInternalName()));
break;
case ExternalKind::Type:
case ExternalKind::Type:
writeHeapType(*curr->getHeapType());
break;
default:
Expand Down Expand Up @@ -4459,26 +4459,26 @@ void WasmBinaryReader::readExports() {
ExternalKind kind = (ExternalKind)getU32LEB();
std::variant<Name, HeapType> value;
switch (kind) {
case ExternalKind::Function:
value = getFunctionName(getU32LEB());
break;
case ExternalKind::Table:
value = getTableName(getU32LEB());
break;
case ExternalKind::Memory:
value = getMemoryName(getU32LEB());
break;
case ExternalKind::Global:
value = getGlobalName(getU32LEB());
break;
case ExternalKind::Tag:
value = getTagName(getU32LEB());
break;
case ExternalKind::Type:
value = getHeapType();
break;
case ExternalKind::Invalid:
throwError("invalid export kind");
case ExternalKind::Function:
value = getFunctionName(getU32LEB());
break;
case ExternalKind::Table:
value = getTableName(getU32LEB());
break;
case ExternalKind::Memory:
value = getMemoryName(getU32LEB());
break;
case ExternalKind::Global:
value = getGlobalName(getU32LEB());
break;
case ExternalKind::Tag:
value = getTagName(getU32LEB());
break;
case ExternalKind::Type:
value = getHeapType();
break;
case ExternalKind::Invalid:
throwError("invalid export kind");
}
wasm.addExport(new Export(name, kind, value));
}
Expand Down
Loading