mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #2100 from chriseth/sol_stackTooDeep
Improved "Stack too deep" error message.
This commit is contained in:
commit
27ac4d6d6f
@ -437,7 +437,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];
|
||||
@ -450,7 +450,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));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user