Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
add missing shared handling in binary reader
  • Loading branch information
tlively committed Jun 25, 2024
commit d848bb79b4493c3d279d346a61d7f0a2d82bf3d7
9 changes: 7 additions & 2 deletions src/wasm/wasm-binary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2272,11 +2272,16 @@ void WasmBinaryReader::readTypes() {
TypeBuilder builder(getU32LEB());
BYN_TRACE("num: " << builder.size() << std::endl);

auto readHeapType = [&]() {
auto readHeapType = [&]() -> HeapType {
int64_t htCode = getS64LEB(); // TODO: Actually s33
auto share = Unshared;
if (htCode == BinaryConsts::EncodedType::Shared) {
share = Shared;
htCode = getS64LEB(); // TODO: Actually s33
}
HeapType ht;
if (getBasicHeapType(htCode, ht)) {
return ht;
return ht.getBasic(share);
}
if (size_t(htCode) >= builder.size()) {
throwError("invalid type index: " + std::to_string(htCode));
Expand Down