diff options
author | Dan Liew <daniel.liew@imperial.ac.uk> | 2016-02-11 06:43:09 +0000 |
---|---|---|
committer | Dan Liew <daniel.liew@imperial.ac.uk> | 2016-02-14 23:55:24 +0000 |
commit | 5960bc6387df8ec89e3e98ae3867b0a3c025033b (patch) | |
tree | ce3a0a149251941b6c557eff1182c9738a81293b /lib | |
parent | 1f13e9dbf9db2095b6612a47717c2b86e4aaba72 (diff) | |
download | klee-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.cpp | 9 |
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) { |