aboutsummaryrefslogtreecommitdiffstats
path: root/libjulia
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-11-30 23:08:09 +0800
committerGitHub <noreply@github.com>2017-11-30 23:08:09 +0800
commitc4cbbb054b5ed3b8ceaa21ee5b47b0704762ff40 (patch)
tree27c068f6cd96513a9023e586c209eb9f01309171 /libjulia
parent9cf6e910bd2b90d0c9415d9c257f85fe0c518de8 (diff)
parentd0af0c14841648365ad05ecc626e672a16df5b5c (diff)
downloaddexon-solidity-c4cbbb054b5ed3b8ceaa21ee5b47b0704762ff40.tar
dexon-solidity-c4cbbb054b5ed3b8ceaa21ee5b47b0704762ff40.tar.gz
dexon-solidity-c4cbbb054b5ed3b8ceaa21ee5b47b0704762ff40.tar.bz2
dexon-solidity-c4cbbb054b5ed3b8ceaa21ee5b47b0704762ff40.tar.lz
dexon-solidity-c4cbbb054b5ed3b8ceaa21ee5b47b0704762ff40.tar.xz
dexon-solidity-c4cbbb054b5ed3b8ceaa21ee5b47b0704762ff40.tar.zst
dexon-solidity-c4cbbb054b5ed3b8ceaa21ee5b47b0704762ff40.zip
Merge pull request #3261 from ethereum/develop
Merge develop into release for 0.4.19
Diffstat (limited to 'libjulia')
-rw-r--r--libjulia/backends/evm/EVMCodeTransform.cpp13
-rw-r--r--libjulia/backends/evm/EVMCodeTransform.h1
2 files changed, 14 insertions, 0 deletions
diff --git a/libjulia/backends/evm/EVMCodeTransform.cpp b/libjulia/backends/evm/EVMCodeTransform.cpp
index 66f593e8..13d9d011 100644
--- a/libjulia/backends/evm/EVMCodeTransform.cpp
+++ b/libjulia/backends/evm/EVMCodeTransform.cpp
@@ -217,6 +217,19 @@ void CodeTransform::operator()(assembly::Instruction const& _instruction)
checkStackHeight(&_instruction);
}
+void CodeTransform::operator()(If const& _if)
+{
+ visitExpression(*_if.condition);
+ m_assembly.setSourceLocation(_if.location);
+ m_assembly.appendInstruction(solidity::Instruction::ISZERO);
+ AbstractAssembly::LabelID end = m_assembly.newLabelId();
+ m_assembly.appendJumpToIf(end);
+ (*this)(_if.body);
+ m_assembly.setSourceLocation(_if.location);
+ m_assembly.appendLabel(end);
+ checkStackHeight(&_if);
+}
+
void CodeTransform::operator()(Switch const& _switch)
{
//@TODO use JUMPV in EVM1.5?
diff --git a/libjulia/backends/evm/EVMCodeTransform.h b/libjulia/backends/evm/EVMCodeTransform.h
index 951c8a50..387720a2 100644
--- a/libjulia/backends/evm/EVMCodeTransform.h
+++ b/libjulia/backends/evm/EVMCodeTransform.h
@@ -104,6 +104,7 @@ public:
void operator()(solidity::assembly::StackAssignment const& _assignment);
void operator()(solidity::assembly::Assignment const& _assignment);
void operator()(solidity::assembly::VariableDeclaration const& _varDecl);
+ void operator()(solidity::assembly::If const& _if);
void operator()(solidity::assembly::Switch const& _switch);
void operator()(solidity::assembly::FunctionDefinition const&);
void operator()(solidity::assembly::ForLoop const&);