mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
IRGenerationContext::internalDispatch(): Fix code generated when the function called via pointer does not return anything
This commit is contained in:
parent
aa071af476
commit
e65a5a562e
@ -122,7 +122,7 @@ string IRGenerationContext::internalDispatch(size_t _in, size_t _out)
|
||||
<#cases>
|
||||
case <funID>
|
||||
{
|
||||
<out> := <name>(<in>)
|
||||
<out> <assignment_op> <name>(<in>)
|
||||
}
|
||||
</cases>
|
||||
default { invalid() }
|
||||
@ -133,6 +133,7 @@ string IRGenerationContext::internalDispatch(size_t _in, size_t _out)
|
||||
YulUtilFunctions utils(m_evmVersion, m_revertStrings, m_functions);
|
||||
templ("in", suffixedVariableNameList("in_", 0, _in));
|
||||
templ("arrow", _out > 0 ? "->" : "");
|
||||
templ("assignment_op", _out > 0 ? ":=" : "");
|
||||
templ("out", suffixedVariableNameList("out_", 0, _out));
|
||||
vector<map<string, string>> functions;
|
||||
for (auto const& contract: mostDerivedContract().annotation().linearizedBaseContracts)
|
||||
|
@ -0,0 +1,19 @@
|
||||
contract test {
|
||||
bool public flag = false;
|
||||
|
||||
function f0() public {
|
||||
flag = true;
|
||||
}
|
||||
|
||||
function f() public returns (bool) {
|
||||
function() internal x = f0;
|
||||
x();
|
||||
return flag;
|
||||
}
|
||||
}
|
||||
|
||||
// ====
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// f() -> true
|
||||
// flag() -> true
|
Loading…
Reference in New Issue
Block a user