about summary refs log tree commit diff homepage
path: root/lib/Core/Executor.h
diff options
context:
space:
mode:
authorCristian Cadar <c.cadar@imperial.ac.uk>2017-07-25 13:40:03 +0100
committerDan Liew <delcypher@gmail.com>2017-07-29 12:54:14 +0100
commitfa4d6690d0413b354afe155f9e3f67f7069a6891 (patch)
tree7bfdbeb90c68085be91bebf6b03aa51396afbd0c /lib/Core/Executor.h
parent1af37be2fb7b874620a1f748e715ba4e75029ca0 (diff)
downloadklee-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.h14
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