mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #8764 from ethereum/sol-yul-fix-pointers-to-functions-returning-nothing
[Sol->Yul] Fix pointers to functions returning nothing
This commit is contained in:
commit
989d1da43c
@ -122,7 +122,7 @@ string IRGenerationContext::internalDispatch(size_t _in, size_t _out)
|
|||||||
<#cases>
|
<#cases>
|
||||||
case <funID>
|
case <funID>
|
||||||
{
|
{
|
||||||
<out> := <name>(<in>)
|
<out> <assignment_op> <name>(<in>)
|
||||||
}
|
}
|
||||||
</cases>
|
</cases>
|
||||||
default { invalid() }
|
default { invalid() }
|
||||||
@ -133,6 +133,7 @@ string IRGenerationContext::internalDispatch(size_t _in, size_t _out)
|
|||||||
YulUtilFunctions utils(m_evmVersion, m_revertStrings, m_functions);
|
YulUtilFunctions utils(m_evmVersion, m_revertStrings, m_functions);
|
||||||
templ("in", suffixedVariableNameList("in_", 0, _in));
|
templ("in", suffixedVariableNameList("in_", 0, _in));
|
||||||
templ("arrow", _out > 0 ? "->" : "");
|
templ("arrow", _out > 0 ? "->" : "");
|
||||||
|
templ("assignment_op", _out > 0 ? ":=" : "");
|
||||||
templ("out", suffixedVariableNameList("out_", 0, _out));
|
templ("out", suffixedVariableNameList("out_", 0, _out));
|
||||||
vector<map<string, string>> functions;
|
vector<map<string, string>> functions;
|
||||||
for (auto const& contract: mostDerivedContract().annotation().linearizedBaseContracts)
|
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