aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/codegen/ExpressionCompiler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libsolidity/codegen/ExpressionCompiler.cpp')
-rw-r--r--libsolidity/codegen/ExpressionCompiler.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/libsolidity/codegen/ExpressionCompiler.cpp b/libsolidity/codegen/ExpressionCompiler.cpp
index 040217da..6dd9d005 100644
--- a/libsolidity/codegen/ExpressionCompiler.cpp
+++ b/libsolidity/codegen/ExpressionCompiler.cpp
@@ -176,6 +176,21 @@ void ExpressionCompiler::appendStateVariableAccessor(VariableDeclaration const&
m_context.appendJump(eth::AssemblyItem::JumpType::OutOfFunction);
}
+bool ExpressionCompiler::visit(Conditional const& _condition)
+{
+ CompilerContext::LocationSetter locationSetter(m_context, _condition);
+ _condition.condition().accept(*this);
+ m_context << eth::Instruction::ISZERO;
+ eth::AssemblyItem falseTag = m_context.appendConditionalJump();
+ _condition.trueExpression().accept(*this);
+ eth::AssemblyItem endTag = m_context.appendJumpToNew();
+ m_context << falseTag;
+ m_context.adjustStackOffset(-1);
+ _condition.falseExpression().accept(*this);
+ m_context << endTag;
+ return false;
+}
+
bool ExpressionCompiler::visit(Assignment const& _assignment)
{
CompilerContext::LocationSetter locationSetter(m_context, _assignment);