3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-06-21 05:13:39 +00:00

Fix installation of custom error handler during context creation in OCaml bindings

This patch fixes a bug detected by valgrind, where a custom error handler
did not get installed correctly.
This commit is contained in:
martin-neuhaeusser 2016-04-11 15:06:28 +02:00 committed by Martin R. Neuhaeusser
parent 324fcc6a13
commit 34bf4b1d3c

View file

@ -436,8 +436,10 @@ void MLErrorHandler(Z3_context c, Z3_error_code e)
n_* wrapper functions. */ n_* wrapper functions. */
} }
void DLL_PUBLIC n_set_internal_error_handler(value a0) CAMLprim value DLL_PUBLIC n_set_internal_error_handler(value ctx_v)
{ {
Z3_context _a0 = * (Z3_context*) Data_custom_val(a0); CAMLparam1(ctx_v);
Z3_set_error_handler(_a0, MLErrorHandler); Z3_context_plus ctx_p = *(Z3_context_plus*) Data_custom_val(ctx_v);
Z3_set_error_handler(ctx_p->ctx, MLErrorHandler);
CAMLreturn(Val_unit);
} }