Respect memory model for revert.

This commit is contained in:
chriseth
2021-05-03 18:23:41 +02:00
parent fe4822a1d2
commit 62355aead3
10 changed files with 114 additions and 104 deletions
@@ -2433,7 +2433,7 @@ void IRGeneratorForStatements::appendExternalFunctionCall(
}
Whiskers templ(R"(
if iszero(extcodesize(<address>)) { <revertNoCode> }
if iszero(extcodesize(<address>)) { <revertNoCode>() }
// storage for arguments and returned data
let <pos> := <allocateUnbounded>()
@@ -2458,7 +2458,7 @@ void IRGeneratorForStatements::appendExternalFunctionCall(
<?+retVars> <retVars> := </+retVars> <abiDecode>(<pos>, add(<pos>, <returnSize>))
}
)");
templ("revertNoCode", m_context.revertReasonIfDebug("Target contract does not contain code"));
templ("revertNoCode", m_utils.revertReasonIfDebugFunction("Target contract does not contain code"));
templ("pos", m_context.newYulVariable());
templ("end", m_context.newYulVariable());
if (_functionCall.annotation().tryCall)