aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/codegen/ExpressionCompiler.cpp
diff options
context:
space:
mode:
authorLu Guanqun <guanqun.lu@gmail.com>2016-01-07 17:14:29 +0800
committerLu Guanqun <guanqun.lu@gmail.com>2016-01-23 01:14:00 +0800
commitb003290638e16e595c25e433f2f65648ea6644da (patch)
tree43acc605fae38011d22a2e01a820ff36d2154348 /libsolidity/codegen/ExpressionCompiler.cpp
parent82ee9503e9b3af35b55318f03caf3dc311a57539 (diff)
downloaddexon-solidity-b003290638e16e595c25e433f2f65648ea6644da.tar.gz
dexon-solidity-b003290638e16e595c25e433f2f65648ea6644da.tar.zst
dexon-solidity-b003290638e16e595c25e433f2f65648ea6644da.zip
[cond-expr] fixup according to code review
Diffstat (limited to 'libsolidity/codegen/ExpressionCompiler.cpp')
-rw-r--r--libsolidity/codegen/ExpressionCompiler.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/libsolidity/codegen/ExpressionCompiler.cpp b/libsolidity/codegen/ExpressionCompiler.cpp
index 5e9c6920..9536c727 100644
--- a/libsolidity/codegen/ExpressionCompiler.cpp
+++ b/libsolidity/codegen/ExpressionCompiler.cpp
@@ -182,10 +182,12 @@ bool ExpressionCompiler::visit(Conditional const& _condition)
_condition.condition().accept(*this);
eth::AssemblyItem trueTag = m_context.appendConditionalJump();
_condition.falseExpression().accept(*this);
+ utils().convertType(*_condition.falseExpression().annotation().type, *_condition.annotation().type);
eth::AssemblyItem endTag = m_context.appendJumpToNew();
m_context << trueTag;
- m_context.adjustStackOffset(-1);
+ m_context.adjustStackOffset(-_condition.annotation().type->sizeOnStack());
_condition.trueExpression().accept(*this);
+ utils().convertType(*_condition.trueExpression().annotation().type, *_condition.annotation().type);
m_context << endTag;
return false;
}