mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Report location on stack too deep if possible
This commit is contained in:
parent
a605e4eb95
commit
af57879187
@ -310,6 +310,7 @@ void CompilerContext::appendInlineAssembly(
|
|||||||
if (stackDiff < 1 || stackDiff > 16)
|
if (stackDiff < 1 || stackDiff > 16)
|
||||||
BOOST_THROW_EXCEPTION(
|
BOOST_THROW_EXCEPTION(
|
||||||
CompilerError() <<
|
CompilerError() <<
|
||||||
|
errinfo_sourceLocation(_identifier.location) <<
|
||||||
errinfo_comment("Stack too deep (" + to_string(stackDiff) + "), try removing local variables.")
|
errinfo_comment("Stack too deep (" + to_string(stackDiff) + "), try removing local variables.")
|
||||||
);
|
);
|
||||||
if (_context == julia::IdentifierContext::RValue)
|
if (_context == julia::IdentifierContext::RValue)
|
||||||
|
@ -174,7 +174,12 @@ void ExpressionCompiler::appendStateVariableAccessor(VariableDeclaration const&
|
|||||||
retSizeOnStack = returnTypes.front()->sizeOnStack();
|
retSizeOnStack = returnTypes.front()->sizeOnStack();
|
||||||
}
|
}
|
||||||
solAssert(retSizeOnStack == utils().sizeOnStack(returnTypes), "");
|
solAssert(retSizeOnStack == utils().sizeOnStack(returnTypes), "");
|
||||||
solAssert(retSizeOnStack <= 15, "Stack is too deep.");
|
if (retSizeOnStack > 15)
|
||||||
|
BOOST_THROW_EXCEPTION(
|
||||||
|
CompilerError() <<
|
||||||
|
errinfo_sourceLocation(_varDecl.location()) <<
|
||||||
|
errinfo_comment("Stack too deep.")
|
||||||
|
);
|
||||||
m_context << dupInstruction(retSizeOnStack + 1);
|
m_context << dupInstruction(retSizeOnStack + 1);
|
||||||
m_context.appendJump(eth::AssemblyItem::JumpType::OutOfFunction);
|
m_context.appendJump(eth::AssemblyItem::JumpType::OutOfFunction);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user