3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-08 18:31:49 +00:00

catch and print exceptions in Z3_mk_config instead of letting them

bubble up the stack
This commit is contained in:
Nicola Mometto 2018-11-27 12:15:33 +00:00
parent 4686429318
commit 29a28f544d

View file

@ -68,10 +68,17 @@ extern "C" {
}
Z3_config Z3_API Z3_mk_config(void) {
memory::initialize(UINT_MAX);
LOG_Z3_mk_config();
Z3_config r = reinterpret_cast<Z3_config>(alloc(context_params));
RETURN_Z3(r);
try {
memory::initialize(UINT_MAX);
LOG_Z3_mk_config();
Z3_config r = reinterpret_cast<Z3_config>(alloc(context_params));
RETURN_Z3(r);
} catch (z3_exception & ex) {
// The error handler is only available for contexts
// Just throw a warning.
warning_msg("%s", ex.msg());
return nullptr;
}
}
void Z3_API Z3_del_config(Z3_config c) {