diff options
author | Cristian Cadar <c.cadar@imperial.ac.uk> | 2016-08-04 16:32:23 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-04 16:32:23 +0100 |
commit | 0186c6fe949b4b8ec9580af3d6a367bd53db56ed (patch) | |
tree | e9658f7e091ca9609a847daf66d1f01a69300bf8 /lib/Core/Executor.h | |
parent | 3966e9e03ac03cf0a2e5b19218f4cbd818e69df1 (diff) | |
parent | bd7e31b6b6ffb5e267af403007d5b8012fdec397 (diff) | |
download | klee-0186c6fe949b4b8ec9580af3d6a367bd53db56ed.tar.gz |
Merge pull request #441 from jirislaby/exit-on-error-type
add --exit-on-error-type option
Diffstat (limited to 'lib/Core/Executor.h')
-rw-r--r-- | lib/Core/Executor.h | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/lib/Core/Executor.h b/lib/Core/Executor.h index 92edc364..93d1443e 100644 --- a/lib/Core/Executor.h +++ b/lib/Core/Executor.h @@ -101,7 +101,24 @@ public: typedef std::pair<ExecutionState*,ExecutionState*> StatePair; + enum TerminateReason { + Abort, + Assert, + Exec, + External, + Free, + Model, + Overflow, + Ptr, + ReadOnly, + ReportError, + User, + Unhandled + }; + private: + static const char *TerminateReasonNames[]; + class TimerInfo; KModule *kmodule; @@ -362,6 +379,8 @@ private: const InstructionInfo & getLastNonKleeInternalInstruction(const ExecutionState &state, llvm::Instruction** lastInstruction); + bool shouldExitOn(enum TerminateReason termReason); + // remove state from queue and delete void terminateState(ExecutionState &state); // call exit handler and terminate state @@ -369,10 +388,10 @@ private: // call exit handler and terminate state void terminateStateOnExit(ExecutionState &state); // call error handler and terminate state - void terminateStateOnError(ExecutionState &state, - const llvm::Twine &message, - const char *suffix, - const llvm::Twine &longMessage=""); + void terminateStateOnError(ExecutionState &state, const llvm::Twine &message, + enum TerminateReason termReason, + const char *suffix = NULL, + const llvm::Twine &longMessage = ""); // call error handler and terminate state, for execution errors // (things that should not be possible, like illegal instruction or @@ -380,7 +399,7 @@ private: void terminateStateOnExecError(ExecutionState &state, const llvm::Twine &message, const llvm::Twine &info="") { - terminateStateOnError(state, message, "exec.err", info); + terminateStateOnError(state, message, Exec, NULL, info); } /// bindModuleConstants - Initialize the module constant table. |