diff options
author | Cristian Cadar <c.cadar@imperial.ac.uk> | 2017-07-25 13:40:03 +0100 |
---|---|---|
committer | Dan Liew <delcypher@gmail.com> | 2017-07-29 12:54:14 +0100 |
commit | fa4d6690d0413b354afe155f9e3f67f7069a6891 (patch) | |
tree | 7bfdbeb90c68085be91bebf6b03aa51396afbd0c /lib/Core/Executor.h | |
parent | 1af37be2fb7b874620a1f748e715ba4e75029ca0 (diff) | |
download | klee-fa4d6690d0413b354afe155f9e3f67f7069a6891.tar.gz |
Added an optional KInstruction* argument to evalConstant and evalConstantExpr which allows us to print the location associated with the constant in any error messages. Added a test case for the unsupported features for taking the address of a label, which exercises the patch.
Diffstat (limited to 'lib/Core/Executor.h')
-rw-r--r-- | lib/Core/Executor.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/Core/Executor.h b/lib/Core/Executor.h index c9d715ad..27cefcc0 100644 --- a/lib/Core/Executor.h +++ b/lib/Core/Executor.h @@ -349,9 +349,17 @@ private: ExecutionState &state, ref<Expr> value); - ref<klee::ConstantExpr> evalConstantExpr(const llvm::ConstantExpr *ce); - - ref<klee::ConstantExpr> evalConstant(const llvm::Constant *c); + /// Evaluates an LLVM constant expression. The optional argument ki + /// is the instruction where this constant was encountered, or NULL + /// if not applicable/unavailable. + ref<klee::ConstantExpr> evalConstantExpr(const llvm::ConstantExpr *c, + const KInstruction *ki = NULL); + + /// Evaluates an LLVM constant. The optional argument ki is the + /// instruction where this constant was encountered, or NULL if + /// not applicable/unavailable. + ref<klee::ConstantExpr> evalConstant(const llvm::Constant *c, + const KInstruction *ki = NULL); /// Return a unique constant value for the given expression in the /// given state, if it has one (i.e. it provably only has a single |