diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-06-07 17:23:52 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-06-07 17:23:52 +0000 |
commit | 1391a42343d7a597b9ee413551ba013218d21b8c (patch) | |
tree | 0879ec3d03fbfae0a27e506c8ca0f993489c914e | |
parent | 5ff59927c677a32bc728462ba00300264c6ad9ae (diff) | |
download | klee-1391a42343d7a597b9ee413551ba013218d21b8c.tar.gz |
Diagnose some more syntax errors instead of crashing.
git-svn-id: https://llvm.org/svn/llvm-project/klee/trunk@73032 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Expr/Parser.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/Expr/Parser.cpp b/lib/Expr/Parser.cpp index f6487674..a5c6123f 100644 --- a/lib/Expr/Parser.cpp +++ b/lib/Expr/Parser.cpp @@ -589,6 +589,12 @@ DeclResult ParserImpl::ParseQueryCommand() { return DeclResult(); } + if (Tok.kind != Token::LSquare) { + Error("malformed query, expected expression list."); + SkipUntilRParen(); + return DeclResult(); + } + ConsumeLSquare(); // FIXME: Should avoid reading past unbalanced parens here. while (Tok.kind != Token::RSquare) { @@ -611,6 +617,12 @@ DeclResult ParserImpl::ParseQueryCommand() { // Return if there are no optional lists of things to evaluate. if (Tok.kind == Token::RParen) goto exit; + + if (Tok.kind != Token::LSquare) { + Error("malformed query, expected expression list."); + SkipUntilRParen(); + return DeclResult(); + } ConsumeLSquare(); // FIXME: Should avoid reading past unbalanced parens here. |