From 5be4570e6d1323e63c5c8a7ccfa16848632a1abc Mon Sep 17 00:00:00 2001 From: "Mike D. Lowis" Date: Fri, 11 May 2012 09:06:44 -0400 Subject: [PATCH] Fixed infinite loop in dlparser --- source/dlparser/dlparser.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/source/dlparser/dlparser.cpp b/source/dlparser/dlparser.cpp index 8af9bdd..c7a9432 100644 --- a/source/dlparser/dlparser.cpp +++ b/source/dlparser/dlparser.cpp @@ -169,7 +169,6 @@ AST* DLParser::Application(void) // Register the new terminator // Consume the name - cout << "Macro Usage" << endl; ret = new AST( MACRO_APP, 1, new AST( lookaheadToken(1) )); consume(); @@ -222,7 +221,21 @@ AST* DLParser::Application(void) AST* DLParser::Literal(void) { AST* ret = new AST( lookaheadToken(1) ); - consume(); + + if( (ID == lookaheadType(1)) || + (CHAR == lookaheadType(1)) || + (STRING == lookaheadType(1)) || + (SYMBOL == lookaheadType(1)) || + (NUM == lookaheadType(1)) ) + { + consume(); + } + else + { + Exception ex( lookaheadToken(1) ); + throw ex; + } + return ret; } -- 2.52.0