Bubble up error messages.

This commit is contained in:
chriseth committed 2018-04-12 13:09:38 +02:00
1 parent ae1d040285
commit 7a9ee69e98
6 files changed
+62 -10

No files matched your search

+13 -5
View File
@@ -262,12 +262,20 @@ CompilerContext& CompilerContext::appendRevert()
return *this << u256(0) << u256(0) << Instruction::REVERT;
}
CompilerContext& CompilerContext::appendConditionalRevert()
CompilerContext& CompilerContext::appendConditionalRevert(bool _forwardReturnData)
{
*this << Instruction::ISZERO;
eth::AssemblyItem afterTag = appendConditionalJump();
appendRevert();
*this << afterTag;
if (_forwardReturnData)
appendInlineAssembly(R"({
if condition {
returndatacopy(0, 0, returndatasize())
revert(0, returndatasize())
}
})", {"condition"});
else
appendInlineAssembly(R"({
if condition { revert(0, 0) }
})", {"condition"});
*this << Instruction::POP;
return *this;
}