Include revert strings in IR

This commit is contained in:
Alex Beregszaszi
2021-01-14 18:45:12 +01:00
committed by chriseth
parent f9bfceccd1
commit 7c7fd22062
6 changed files with 20 additions and 6 deletions
@@ -2364,7 +2364,7 @@ void IRGeneratorForStatements::appendExternalFunctionCall(
}
Whiskers templ(R"(
if iszero(extcodesize(<address>)) { revert(0, 0) }
if iszero(extcodesize(<address>)) { <revertNoCode> }
// storage for arguments and returned data
let <pos> := <freeMemory>
@@ -2389,6 +2389,7 @@ void IRGeneratorForStatements::appendExternalFunctionCall(
<?+retVars> <retVars> := </+retVars> <abiDecode>(<pos>, add(<pos>, <returnSize>))
}
)");
templ("revertNoCode", m_context.revertReasonIfDebug("Target contract does not contain code"));
templ("pos", m_context.newYulVariable());
templ("end", m_context.newYulVariable());
if (_functionCall.annotation().tryCall)