aboutsummaryrefslogtreecommitdiffstats
path: root/ExpressionCompiler.cpp
diff options
context:
space:
mode:
authorliana <liana@ethdev.com>2015-01-16 23:26:57 +0800
committerliana <liana@ethdev.com>2015-01-16 23:26:57 +0800
commitc3d36d1fe197156427cd8adb4edbf955bba0531a (patch)
tree16cb326ad70290566d68135efff60964e2fbf880 /ExpressionCompiler.cpp
parenta0ec9c66801f27ce5436c35c120f86215ca7977f (diff)
downloaddexon-solidity-c3d36d1fe197156427cd8adb4edbf955bba0531a.tar.gz
dexon-solidity-c3d36d1fe197156427cd8adb4edbf955bba0531a.tar.zst
dexon-solidity-c3d36d1fe197156427cd8adb4edbf955bba0531a.zip
- corrected delete in case we have more than one locals
- added a test
Diffstat (limited to 'ExpressionCompiler.cpp')
-rw-r--r--ExpressionCompiler.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/ExpressionCompiler.cpp b/ExpressionCompiler.cpp
index 775d59a3..b90032da 100644
--- a/ExpressionCompiler.cpp
+++ b/ExpressionCompiler.cpp
@@ -810,9 +810,9 @@ void ExpressionCompiler::LValue::setToZero(Expression const& _expression) const
if (stackDiff > 16)
BOOST_THROW_EXCEPTION(CompilerError() << errinfo_sourceLocation(_expression.getLocation())
<< errinfo_comment("Stack too deep."));
- solAssert(stackDiff <= m_size, "");
+ solAssert(stackDiff >= m_size - 1, "");
for (unsigned i = 0; i < m_size; ++i)
- *m_context << u256(0) << eth::swapInstruction(stackDiff + (m_size - i) )
+ *m_context << u256(0) << eth::swapInstruction(stackDiff + 1 - i)
<< eth::Instruction::POP;
break;
}