Change translation of implicit throws (issue #1589).

This adds a new invalid instruction that is used for encoding
implicit throws that are emitted by the compiler. This makes it
possible to distinguish such runtime errors from user-provided,
explicit throws.
This commit is contained in:
Valentin Wüstholz authored and chriseth committed 2017-01-26 16:39:07 +01:00
1 parent 102fd7ee5d
commit 9bcbd93ac5
10 files changed
+49 -17

No files matched your search

+12
View File
@@ -215,6 +215,18 @@ CompilerContext& CompilerContext::appendJump(eth::AssemblyItem::JumpType _jumpTy
return *this << item;
}
CompilerContext& CompilerContext::appendInvalid()
{
return *this << Instruction::INVALID;
}
CompilerContext& CompilerContext::appendConditionalInvalid()
{
eth::AssemblyItem falseTag = appendConditionalJump();
eth::AssemblyItem endTag = appendJumpToNew();
return *this << falseTag << Instruction::INVALID << endTag;
}
void CompilerContext::resetVisitedNodes(ASTNode const* _node)
{
stack<ASTNode const*> newStack;