Merge pull request #11224 from ethereum/lastAllocationUnbounded

Use unbounded allocation before returning.
This commit is contained in:
chriseth
2021-04-08 19:32:40 +02:00
committed by GitHub
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);