diff options
author | Valentin Wüstholz <wuestholz@gmail.com> | 2017-01-23 17:46:50 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2017-01-26 23:39:07 +0800 |
commit | 5b7cc018f0b256fb42f7bee38ad8d1ec4e2ec634 (patch) | |
tree | 95f65ad06ee940ad3db7a73d6c4cb29c603cbe3c /libsolidity | |
parent | 9bcbd93ac59a19320fd56e27c58a6283f2450666 (diff) | |
download | dexon-solidity-5b7cc018f0b256fb42f7bee38ad8d1ec4e2ec634.tar dexon-solidity-5b7cc018f0b256fb42f7bee38ad8d1ec4e2ec634.tar.gz dexon-solidity-5b7cc018f0b256fb42f7bee38ad8d1ec4e2ec634.tar.bz2 dexon-solidity-5b7cc018f0b256fb42f7bee38ad8d1ec4e2ec634.tar.lz dexon-solidity-5b7cc018f0b256fb42f7bee38ad8d1ec4e2ec634.tar.xz dexon-solidity-5b7cc018f0b256fb42f7bee38ad8d1ec4e2ec634.tar.zst dexon-solidity-5b7cc018f0b256fb42f7bee38ad8d1ec4e2ec634.zip |
Address feedback from code review.
Diffstat (limited to 'libsolidity')
-rw-r--r-- | libsolidity/codegen/CompilerContext.cpp | 6 | ||||
-rw-r--r-- | libsolidity/codegen/ContractCompiler.cpp | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/libsolidity/codegen/CompilerContext.cpp b/libsolidity/codegen/CompilerContext.cpp index 45450350..3bb6c953 100644 --- a/libsolidity/codegen/CompilerContext.cpp +++ b/libsolidity/codegen/CompilerContext.cpp @@ -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) diff --git a/libsolidity/codegen/ContractCompiler.cpp b/libsolidity/codegen/ContractCompiler.cpp index 56d03a05..3ca2f375 100644 --- a/libsolidity/codegen/ContractCompiler.cpp +++ b/libsolidity/codegen/ContractCompiler.cpp @@ -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); |