diff options
author | chriseth <chris@ethereum.org> | 2017-08-24 17:14:01 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-24 17:14:01 +0800 |
commit | 8af6f193bcf279381df3cca51b179b48e9cf5d5d (patch) | |
tree | 145ac3b1ed28a705d79f79ffd6366f5ad93d3aff /libsolidity/parsing/Parser.cpp | |
parent | 9c74473a9b08bfc58d97a46aceb8869c24095276 (diff) | |
parent | 628b54ce351dd5de8ec34aa8c2c23f2fd0a77d90 (diff) | |
download | dexon-solidity-8af6f193bcf279381df3cca51b179b48e9cf5d5d.tar dexon-solidity-8af6f193bcf279381df3cca51b179b48e9cf5d5d.tar.gz dexon-solidity-8af6f193bcf279381df3cca51b179b48e9cf5d5d.tar.bz2 dexon-solidity-8af6f193bcf279381df3cca51b179b48e9cf5d5d.tar.lz dexon-solidity-8af6f193bcf279381df3cca51b179b48e9cf5d5d.tar.xz dexon-solidity-8af6f193bcf279381df3cca51b179b48e9cf5d5d.tar.zst dexon-solidity-8af6f193bcf279381df3cca51b179b48e9cf5d5d.zip |
Merge pull request #2770 from ethereum/recursionInAsm
Also prevent too much recursion in the assembly parser.
Diffstat (limited to 'libsolidity/parsing/Parser.cpp')
-rw-r--r-- | libsolidity/parsing/Parser.cpp | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/libsolidity/parsing/Parser.cpp b/libsolidity/parsing/Parser.cpp index 92a614e0..cd0d6157 100644 --- a/libsolidity/parsing/Parser.cpp +++ b/libsolidity/parsing/Parser.cpp @@ -64,25 +64,6 @@ private: SourceLocation m_location; }; -/// Utility class that creates an error and throws an exception if the -/// recursion depth is too deep. -class Parser::RecursionGuard -{ -public: - explicit RecursionGuard(Parser& _parser): - m_parser(_parser) - { - m_parser.increaseRecursionDepth(); - } - ~RecursionGuard() - { - m_parser.decreaseRecursionDepth(); - } - -private: - Parser& m_parser; -}; - ASTPointer<SourceUnit> Parser::parse(shared_ptr<Scanner> const& _scanner) { try @@ -1543,19 +1524,6 @@ ASTPointer<ParameterList> Parser::createEmptyParameterList() return nodeFactory.createNode<ParameterList>(vector<ASTPointer<VariableDeclaration>>()); } -void Parser::increaseRecursionDepth() -{ - m_recursionDepth++; - if (m_recursionDepth >= 4096) - fatalParserError("Maximum recursion depth reached during parsing."); -} - -void Parser::decreaseRecursionDepth() -{ - solAssert(m_recursionDepth > 0, ""); - m_recursionDepth--; -} - string Parser::currentTokenName() { Token::Value token = m_scanner->currentToken(); |