mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Check recursion depth in assembly parser.
This commit is contained in:
@@ -101,6 +101,19 @@ void ParserBase::expectToken(Token::Value _value)
|
||||
m_scanner->next();
|
||||
}
|
||||
|
||||
void ParserBase::increaseRecursionDepth()
|
||||
{
|
||||
m_recursionDepth++;
|
||||
if (m_recursionDepth >= 4096)
|
||||
fatalParserError("Maximum recursion depth reached during parsing.");
|
||||
}
|
||||
|
||||
void ParserBase::decreaseRecursionDepth()
|
||||
{
|
||||
solAssert(m_recursionDepth > 0, "");
|
||||
m_recursionDepth--;
|
||||
}
|
||||
|
||||
void ParserBase::parserError(string const& _description)
|
||||
{
|
||||
m_errorReporter.parserError(SourceLocation(position(), position(), sourceName()), _description);
|
||||
|
||||
Reference in New Issue
Block a user