Merge pull request #664 from chriseth/sol_fix_compoundAssign

Bugfix: Additional swap for compound assignment.
This commit is contained in:
chriseth 2014-12-19 11:38:45 +01:00
commit 8e3fbbad44

View File

@ -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();