Skip to content

Commit

Permalink
Memory will now be exported in WASI mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Maqrkk authored and alexp-sssup committed Oct 5, 2023
1 parent 04a5980 commit 983ec09
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions llvm/lib/CheerpWriter/CheerpWasmWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4796,10 +4796,11 @@ void CheerpWasmWriter::compileExportSection()
globalDeps.asmJSExports().end());

// We may need to export the table and/or the memory.
uint32_t extraExports = uint32_t(exportedTable) + uint32_t(WasmExportedMemory);
bool exportMemory = WasmExportedMemory || !useWasmLoader;
uint32_t extraExports = uint32_t(exportedTable) + uint32_t(exportMemory);
encodeULEB128(exports.size() + extraExports, section);

if (WasmExportedMemory)
if (exportMemory)
{
// Encode the memory.
StringRef name = useWasmLoader? namegen.getBuiltinName(NameGenerator::MEMORY) : "memory";
Expand Down

0 comments on commit 983ec09

Please sign in to comment.