aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity
diff options
context:
space:
mode:
authorRJ <catalanor0220@gmail.com>2016-01-11 11:49:36 +0800
committerRJ <catalanor0220@gmail.com>2016-01-11 11:49:36 +0800
commitc78b9c57375eff644310ca62ce87d07bb576fd28 (patch)
treefa549a7182f60dde90fbd622a21d120d4e5a933c /libsolidity
parent72a641fe9f4f040586c7f563601ddda987df4f0b (diff)
downloaddexon-solidity-c78b9c57375eff644310ca62ce87d07bb576fd28.tar
dexon-solidity-c78b9c57375eff644310ca62ce87d07bb576fd28.tar.gz
dexon-solidity-c78b9c57375eff644310ca62ce87d07bb576fd28.tar.bz2
dexon-solidity-c78b9c57375eff644310ca62ce87d07bb576fd28.tar.lz
dexon-solidity-c78b9c57375eff644310ca62ce87d07bb576fd28.tar.xz
dexon-solidity-c78b9c57375eff644310ca62ce87d07bb576fd28.tar.zst
dexon-solidity-c78b9c57375eff644310ca62ce87d07bb576fd28.zip
Update ExpressionCompiler.cpp
Diffstat (limited to 'libsolidity')
-rw-r--r--libsolidity/codegen/ExpressionCompiler.cpp30
1 files changed, 16 insertions, 14 deletions
diff --git a/libsolidity/codegen/ExpressionCompiler.cpp b/libsolidity/codegen/ExpressionCompiler.cpp
index c930c468..c5f0f97e 100644
--- a/libsolidity/codegen/ExpressionCompiler.cpp
+++ b/libsolidity/codegen/ExpressionCompiler.cpp
@@ -186,6 +186,7 @@ bool ExpressionCompiler::visit(Assignment const& _assignment)
_assignment.leftHandSide().annotation().type
);
utils().convertType(*_assignment.rightHandSide().annotation().type, *type);
+
_assignment.leftHandSide().accept(*this);
solAssert(!!m_currentLValue, "LValue not retrieved.");
@@ -219,23 +220,24 @@ bool ExpressionCompiler::visit(Assignment const& _assignment)
bool ExpressionCompiler::visit(TupleExpression const& _tuple)
{
if (_tuple.isInlineArray())
- {
- ArrayType const& arrayType = dynamic_cast<ArrayType const&>(*_tuple.annotation().type);
- auto components = _tuple.components();
-
- m_context << max(u256(32u), arrayType.memorySize());
- utils().allocateMemory();
- m_context << eth::Instruction::DUP1;
-
- for (unsigned i = 0; i < components.size(); ++i)
- {
- components[i]->accept(*this);
+ {
+ ArrayType const& arrayType = dynamic_cast<ArrayType const&>(*_tuple.annotation().type);
+ auto components = _tuple.components();
+
+ m_context << max(u256(32u), arrayType.memorySize());
+ utils().allocateMemory();
+ m_context << eth::Instruction::DUP1;
+
+ for (unsigned i = 0; i < components.size(); ++i)
+ {
+ components[i]->accept(*this);
utils().convertType(*components[i]->annotation().type, *arrayType.baseType(), true);
components[i]->annotation().type = arrayType.baseType(); //force conversion
utils().storeInMemoryDynamic(*components[i]->annotation().type, true);
- }
- m_context << eth::Instruction::POP;
- }
+ }
+
+ m_context << eth::Instruction::POP;
+ }
else
{
vector<unique_ptr<LValue>> lvalues;