mirror of
https://github.com/Z3Prover/z3
synced 2025-06-20 12:53:38 +00:00
catch and print exceptions in Z3_mk_config instead of letting them
bubble up the stack
This commit is contained in:
parent
4686429318
commit
29a28f544d
1 changed files with 11 additions and 4 deletions
|
@ -68,10 +68,17 @@ extern "C" {
|
||||||
}
|
}
|
||||||
|
|
||||||
Z3_config Z3_API Z3_mk_config(void) {
|
Z3_config Z3_API Z3_mk_config(void) {
|
||||||
|
try {
|
||||||
memory::initialize(UINT_MAX);
|
memory::initialize(UINT_MAX);
|
||||||
LOG_Z3_mk_config();
|
LOG_Z3_mk_config();
|
||||||
Z3_config r = reinterpret_cast<Z3_config>(alloc(context_params));
|
Z3_config r = reinterpret_cast<Z3_config>(alloc(context_params));
|
||||||
RETURN_Z3(r);
|
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) {
|
void Z3_API Z3_del_config(Z3_config c) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue