about summary refs log tree commit diff homepage
path: root/lib
diff options
context:
space:
mode:
authorDan Liew <daniel.liew@imperial.ac.uk>2016-02-11 06:43:09 +0000
committerDan Liew <daniel.liew@imperial.ac.uk>2016-02-14 23:55:24 +0000
commit5960bc6387df8ec89e3e98ae3867b0a3c025033b (patch)
treece3a0a149251941b6c557eff1182c9738a81293b /lib
parent1f13e9dbf9db2095b6612a47717c2b86e4aaba72 (diff)
downloadklee-5960bc6387df8ec89e3e98ae3867b0a3c025033b.tar.gz
Handle Z3 API change between 4.4.1 and the current master branch
for the ``Z3_get_error_msg()`` function.
Diffstat (limited to 'lib')
-rw-r--r--lib/Solver/Z3Builder.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/Solver/Z3Builder.cpp b/lib/Solver/Z3Builder.cpp
index f928c927..ae78c21c 100644
--- a/lib/Solver/Z3Builder.cpp
+++ b/lib/Solver/Z3Builder.cpp
@@ -27,7 +27,14 @@ llvm::cl::opt<bool> UseConstructHashZ3(
 }
 
 void custom_z3_error_handler(Z3_context ctx, Z3_error_code ec) {
-  ::Z3_string errorMsg = Z3_get_error_msg(ctx, ec);
+  ::Z3_string errorMsg =
+#ifdef HAVE_Z3_GET_ERROR_MSG_NEEDS_CONTEXT
+      // Z3 > 4.4.1
+      Z3_get_error_msg(ctx, ec);
+#else
+      // Z3 4.4.1
+      Z3_get_error_msg(ec);
+#endif
   // FIXME: This is kind of a hack. The value comes from the enum
   // Z3_CANCELED_MSG but this isn't currently exposed by Z3's C API
   if (strcmp(errorMsg, "canceled") == 0) {