Merge pull request #10388 from ethereum/forwardRevertOnCreate

[Sol->Yul] Forward failure for creation.
This commit is contained in:
chriseth
2020-11-25 10:39:54 +01:00
committed by GitHub
7 changed files with 26 additions and 5 deletions
@@ -1412,6 +1412,8 @@ void IRGeneratorForStatements::endVisit(FunctionCall const& _functionCall)
</saltSet>
<?isTryCall>
let <success> := iszero(iszero(<address>))
<!isTryCall>
if iszero(<address>) { <forwardingRevert>() }
</isTryCall>
<releaseTemporaryMemory>()
)");
@@ -1434,6 +1436,8 @@ void IRGeneratorForStatements::endVisit(FunctionCall const& _functionCall)
t("isTryCall", _functionCall.annotation().tryCall);
if (_functionCall.annotation().tryCall)
t("success", IRNames::trySuccessConditionVariable(_functionCall));
else
t("forwardingRevert", m_utils.forwardingRevertFunction());
m_code << t.render();
break;