diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-06-05 08:11:30 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-06-05 08:11:30 +0000 |
commit | 6c3de732d53bc0953078f1f102ba824161f39cd0 (patch) | |
tree | db2bfdda80c84b5dc0578926e2c9d061fe3692d2 | |
parent | d5102295ea7f5780119108f0b8cf118ad7c04311 (diff) | |
download | klee-6c3de732d53bc0953078f1f102ba824161f39cd0.tar.gz |
Don't evaluate queries if there were parse failures.
git-svn-id: https://llvm.org/svn/llvm-project/klee/trunk@72934 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | tools/kleaver/main.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/tools/kleaver/main.cpp b/tools/kleaver/main.cpp index 7c437e47..7525eb7a 100644 --- a/tools/kleaver/main.cpp +++ b/tools/kleaver/main.cpp @@ -109,9 +109,16 @@ static bool EvaluateInputAST(const char *Filename, llvm::cerr << Filename << ": parse failure: " << N << " errors.\n"; success = false; - } + } delete P; + if (!success) { + for (std::vector<Decl*>::iterator it = Decls.begin(), + ie = Decls.end(); it != ie; ++it) + delete *it; + return success; + } + // FIXME: Support choice of solver. Solver *S, *STP = new STPSolver(true); S = createCexCachingSolver(STP); @@ -156,7 +163,7 @@ int main(int argc, char **argv) { std::string ErrorStr; MemoryBuffer *MB = MemoryBuffer::getFileOrSTDIN(InputFile.c_str(), &ErrorStr); if (!MB) { - llvm::cerr << argv[0] << ": ERROR: " << ErrorStr << "\n"; + llvm::cerr << argv[0] << ": error: " << ErrorStr << "\n"; return 1; } @@ -172,7 +179,7 @@ int main(int argc, char **argv) { MB); break; default: - llvm::cerr << argv[0] << ": ERROR: Unknown program action!\n"; + llvm::cerr << argv[0] << ": error: Unknown program action!\n"; } delete MB; |