Use unbounded allocation before returning.

This commit is contained in:
Daniel Kirchner
2021-04-08 18:37:24 +02:00
parent c060bd5633
commit 96c8123b6b
135 changed files with 200 additions and 393 deletions
+2 -2
View File
@@ -870,7 +870,7 @@ string IRGenerator::dispatchRoutine(ContractDefinition const& _contract)
<callValueCheck>
<?+params>let <params> := </+params> <abiDecode>(4, calldatasize())
<?+retParams>let <retParams> := </+retParams> <function>(<params>)
let memPos := <allocate>(0)
let memPos := <allocateUnbounded>()
let memEnd := <abiEncode>(memPos <?+retParams>,</+retParams> <retParams>)
return(memPos, sub(memEnd, memPos))
}
@@ -919,7 +919,7 @@ string IRGenerator::dispatchRoutine(ContractDefinition const& _contract)
else
solAssert(false, "Unexpected declaration for function!");
templ["allocate"] = m_utils.allocationFunction();
templ["allocateUnbounded"] = m_utils.allocateUnboundedFunction();
templ["abiEncode"] = abiFunctions.tupleEncoder(type->returnParameterTypes(), type->returnParameterTypes(), _contract.isLibrary());
}
t("cases", functions);