aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2015-06-06 07:04:55 +0800
committerchriseth <c@ethdev.com>2015-06-07 18:51:15 +0800
commit13a20d837219588c9459d35d3f8ae714afc7668b (patch)
treebe487ccda9732b5392ef63f60fd3d4beaef896be
parentcad767de61dc53b9b297f08ee09cb5a3c0821782 (diff)
downloaddexon-solidity-13a20d837219588c9459d35d3f8ae714afc7668b.tar.gz
dexon-solidity-13a20d837219588c9459d35d3f8ae714afc7668b.tar.zst
dexon-solidity-13a20d837219588c9459d35d3f8ae714afc7668b.zip
Improved "Stack too deep" error message.
Closes #2080.
-rw-r--r--CommonSubexpressionEliminator.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/CommonSubexpressionEliminator.cpp b/CommonSubexpressionEliminator.cpp
index b2fa7311..a441bd8b 100644
--- a/CommonSubexpressionEliminator.cpp
+++ b/CommonSubexpressionEliminator.cpp
@@ -428,7 +428,7 @@ void CSECodeGenerator::appendDup(int _fromPosition, SourceLocation const& _locat
{
assertThrow(_fromPosition != c_invalidPosition, OptimizerException, "");
int instructionNum = 1 + m_stackHeight - _fromPosition;
- assertThrow(instructionNum <= 16, StackTooDeepException, "Stack too deep.");
+ assertThrow(instructionNum <= 16, StackTooDeepException, "Stack too deep, try removing local variables.");
assertThrow(1 <= instructionNum, OptimizerException, "Invalid stack access.");
appendItem(AssemblyItem(dupInstruction(instructionNum), _location));
m_stack[m_stackHeight] = m_stack[_fromPosition];
@@ -441,7 +441,7 @@ void CSECodeGenerator::appendOrRemoveSwap(int _fromPosition, SourceLocation cons
if (_fromPosition == m_stackHeight)
return;
int instructionNum = m_stackHeight - _fromPosition;
- assertThrow(instructionNum <= 16, StackTooDeepException, "Stack too deep.");
+ assertThrow(instructionNum <= 16, StackTooDeepException, "Stack too deep, try removing local variables.");
assertThrow(1 <= instructionNum, OptimizerException, "Invalid stack access.");
appendItem(AssemblyItem(swapInstruction(instructionNum), _location));