mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Bubble up error messages.
This commit is contained in:
1 parent
ae1d040285
commit
7a9ee69e98
6 files changed
+62
-10
No files matched your search
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user