Address feedback from code review.

This commit is contained in:
Valentin Wüstholz
2017-01-26 16:39:07 +01:00
committed by chriseth
parent 9bcbd93ac5
commit 5b7cc018f0
5 changed files with 12 additions and 16 deletions
+3 -3
View File
@@ -222,9 +222,9 @@ CompilerContext& CompilerContext::appendInvalid()
CompilerContext& CompilerContext::appendConditionalInvalid()
{
eth::AssemblyItem falseTag = appendConditionalJump();
eth::AssemblyItem endTag = appendJumpToNew();
return *this << falseTag << Instruction::INVALID << endTag;
*this << Instruction::ISZERO;
eth::AssemblyItem afterTag = appendConditionalJump();
return *this << Instruction::INVALID << afterTag;
}
void CompilerContext::resetVisitedNodes(ASTNode const* _node)
+3 -3
View File
@@ -918,9 +918,9 @@ eth::AssemblyPointer ContractCompiler::cloneRuntime()
a << Instruction::DELEGATECALL;
//Propagate error condition (if DELEGATECALL pushes 0 on stack).
a << Instruction::ISZERO;
eth::AssemblyItem falseTag = a.appendJumpI();
eth::AssemblyItem endTag = a.appendJump().tag();
a << falseTag << Instruction::INVALID << endTag;
a << Instruction::ISZERO;
eth::AssemblyItem afterTag = a.appendJumpI();
a << Instruction::INVALID << afterTag;
//@todo adjust for larger return values, make this dynamic.
a << u256(0x20) << u256(0) << Instruction::RETURN;
return make_shared<eth::Assembly>(a);