Skip to content

Commit

Permalink
Fix wasm loader not properly using supplied buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
DutChen18 authored and alexp-sssup committed Sep 29, 2023
1 parent 5895e18 commit 613e87d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion llvm/lib/CheerpWriter/CheerpWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6120,7 +6120,7 @@ void CheerpWriter::compileFetchBufferCall(const std::string& fileName, const std
{
if (makeModule == MODULE_TYPE::ES6)
{
stream << "(" << argumentName << "&&" << argumentName << ".buffer)?" << NewLine;
stream << "((" << argumentName << "&&" << argumentName << ".buffer)?" << NewLine;
stream << "Promise.resolve(" << argumentName << ".buffer):" << NewLine;
}
stream << namegen.getBuiltinName(NameGenerator::FETCHBUFFER) << "(";
Expand All @@ -6135,6 +6135,8 @@ void CheerpWriter::compileFetchBufferCall(const std::string& fileName, const std
if (makeModule == MODULE_TYPE::ES6)
stream << ", import.meta.url)";
stream << ")";
if (makeModule == MODULE_TYPE::ES6)
stream << ")";
}

void CheerpWriter::compileSourceMapsBegin()
Expand Down

0 comments on commit 613e87d

Please sign in to comment.