Only forward returndata if EVM version supports it.

This commit is contained in:
chriseth
2018-04-12 13:09:38 +02:00
parent 42c4c78390
commit fcb7a27216
2 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -264,7 +264,7 @@ CompilerContext& CompilerContext::appendRevert()
CompilerContext& CompilerContext::appendConditionalRevert(bool _forwardReturnData)
{
if (_forwardReturnData)
if (_forwardReturnData && m_evmVersion.supportsReturndata())
appendInlineAssembly(R"({
if condition {
returndatacopy(0, 0, returndatasize())
+2
View File
@@ -158,6 +158,8 @@ public:
CompilerContext& appendRevert();
/// Appends a conditional REVERT-call, either forwarding the RETURNDATA or providing the
/// empty string. Consumes the condition.
/// If the current EVM version does not support RETURNDATA, uses REVERT but does not forward
/// the data.
CompilerContext& appendConditionalRevert(bool _forwardReturnData = false);
/// Appends a JUMP to a specific tag
CompilerContext& appendJumpTo(eth::AssemblyItem const& _tag) { m_asm->appendJump(_tag); return *this; }