aboutsummaryrefslogtreecommitdiffstats
path: root/ExpressionCompiler.cpp
diff options
context:
space:
mode:
authorChristian <c@ethdev.com>2014-12-19 05:15:11 +0800
committerChristian <c@ethdev.com>2014-12-19 05:23:34 +0800
commit8dbe13f840acb4846ef3b7f8fc3988433cba6288 (patch)
treea1f5e6e23489de1b9825ee49966a6d1e32f1731a /ExpressionCompiler.cpp
parent1da53d1681cbccbb18d08659787042d53438b5c3 (diff)
downloaddexon-solidity-8dbe13f840acb4846ef3b7f8fc3988433cba6288.tar.gz
dexon-solidity-8dbe13f840acb4846ef3b7f8fc3988433cba6288.tar.zst
dexon-solidity-8dbe13f840acb4846ef3b7f8fc3988433cba6288.zip
Bugfix: Additional swap for compound assignment.
Diffstat (limited to 'ExpressionCompiler.cpp')
-rw-r--r--ExpressionCompiler.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/ExpressionCompiler.cpp b/ExpressionCompiler.cpp
index f58c157d..cf641935 100644
--- a/ExpressionCompiler.cpp
+++ b/ExpressionCompiler.cpp
@@ -62,6 +62,8 @@ bool ExpressionCompiler::visit(Assignment const& _assignment)
m_context << eth::Instruction::SWAP1 << eth::Instruction::DUP2;
m_currentLValue.retrieveValue(_assignment, true);
appendOrdinaryBinaryOperatorCode(Token::AssignmentToBinaryOp(op), *_assignment.getType());
+ if (m_currentLValue.storesReferenceOnStack())
+ m_context << eth::Instruction::SWAP1;
}
m_currentLValue.storeValue(_assignment);
m_currentLValue.reset();