mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
[ewasm] Allow compiling Yul without "main"
This commit is contained in:
@@ -56,8 +56,13 @@ string TextTransform::run(wasm::Module const& _module)
|
||||
|
||||
// allocate one 64k page of memory and make it available to the Ethereum client
|
||||
ret += " (memory $memory (export \"memory\") 1)\n";
|
||||
// export the main function
|
||||
ret += " (export \"main\" (func $main))\n";
|
||||
for (auto const& f: _module.functions)
|
||||
if (f.name == "main")
|
||||
{
|
||||
// export the main function
|
||||
ret += " (export \"main\" (func $main))\n";
|
||||
break;
|
||||
}
|
||||
|
||||
for (auto const& g: _module.globals)
|
||||
ret += " (global $" + g.variableName + " (mut " + encodeType(g.type) + ") (" + encodeType(g.type) + ".const 0))\n";
|
||||
|
||||
Reference in New Issue
Block a user