3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-24 17:45:32 +00:00
This commit is contained in:
Nikolaj Bjorner 2022-05-16 16:44:13 -07:00
parent f6b2874d7c
commit 363b69f588
10 changed files with 19 additions and 21 deletions

View file

@ -52,7 +52,6 @@ extern "C" {
void Z3_API Z3_ast_map_dec_ref(Z3_context c, Z3_ast_map m) {
Z3_TRY;
LOG_Z3_ast_map_dec_ref(c, m);
RESET_ERROR_CODE();
if (m)
to_ast_map(m)->dec_ref();
Z3_CATCH;

View file

@ -47,7 +47,6 @@ extern "C" {
void Z3_API Z3_ast_vector_dec_ref(Z3_context c, Z3_ast_vector v) {
Z3_TRY;
LOG_Z3_ast_vector_dec_ref(c, v);
RESET_ERROR_CODE();
if (v)
to_ast_vector(v)->dec_ref();
Z3_CATCH;

View file

@ -374,8 +374,9 @@ extern "C" {
void Z3_API Z3_dec_ref(Z3_context c, Z3_ast a) {
Z3_TRY;
LOG_Z3_dec_ref(c, a);
RESET_ERROR_CODE();
if (a && to_ast(a)->get_ref_count() == 0) {
// the error is unchecked (but should not happen) in GC'ed wrappers
RESET_ERROR_CODE();
SET_ERROR_CODE(Z3_DEC_REF_ERROR, nullptr);
return;
}

View file

@ -52,7 +52,6 @@ extern "C" {
void Z3_API Z3_goal_dec_ref(Z3_context c, Z3_goal g) {
Z3_TRY;
LOG_Z3_goal_dec_ref(c, g);
RESET_ERROR_CODE();
if (g)
to_goal(g)->dec_ref();
Z3_CATCH;

View file

@ -53,7 +53,6 @@ extern "C" {
void Z3_API Z3_model_dec_ref(Z3_context c, Z3_model m) {
Z3_TRY;
LOG_Z3_model_dec_ref(c, m);
RESET_ERROR_CODE();
if (m) {
to_model(m)->dec_ref();
}

View file

@ -67,7 +67,6 @@ extern "C" {
void Z3_API Z3_optimize_dec_ref(Z3_context c, Z3_optimize o) {
Z3_TRY;
LOG_Z3_optimize_dec_ref(c, o);
RESET_ERROR_CODE();
if (o)
to_optimize(o)->dec_ref();
Z3_CATCH;

View file

@ -54,7 +54,6 @@ extern "C" {
void Z3_API Z3_params_dec_ref(Z3_context c, Z3_params p) {
Z3_TRY;
LOG_Z3_params_dec_ref(c, p);
RESET_ERROR_CODE();
if (p)
to_params(p)->dec_ref();
Z3_CATCH;
@ -141,8 +140,8 @@ extern "C" {
void Z3_API Z3_param_descrs_dec_ref(Z3_context c, Z3_param_descrs p) {
Z3_TRY;
LOG_Z3_param_descrs_dec_ref(c, p);
RESET_ERROR_CODE();
to_param_descrs(p)->dec_ref();
if (p)
to_param_descrs(p)->dec_ref();
Z3_CATCH;
}

View file

@ -207,7 +207,7 @@ extern "C" {
if (!smt_logics::supported_logic(to_symbol(logic))) {
std::ostringstream strm;
strm << "logic '" << to_symbol(logic) << "' is not recognized";
throw default_exception(strm.str());
SET_ERROR_CODE(Z3_INVALID_ARG, strm.str());
RETURN_Z3(nullptr);
}
else {
@ -412,9 +412,8 @@ extern "C" {
void Z3_API Z3_solver_dec_ref(Z3_context c, Z3_solver s) {
Z3_TRY;
LOG_Z3_solver_dec_ref(c, s);
RESET_ERROR_CODE();
if (s)
to_solver(s)->dec_ref();
if (s)
to_solver(s)->dec_ref();
Z3_CATCH;
}

View file

@ -73,7 +73,6 @@ extern "C" {
void Z3_API Z3_tactic_dec_ref(Z3_context c, Z3_tactic t) {
Z3_TRY;
LOG_Z3_tactic_dec_ref(c, t);
RESET_ERROR_CODE();
if (t)
to_tactic(t)->dec_ref();
Z3_CATCH;
@ -104,7 +103,6 @@ extern "C" {
void Z3_API Z3_probe_dec_ref(Z3_context c, Z3_probe p) {
Z3_TRY;
LOG_Z3_probe_dec_ref(c, p);
RESET_ERROR_CODE();
if (p)
to_probe(p)->dec_ref();
Z3_CATCH;
@ -477,7 +475,6 @@ extern "C" {
void Z3_API Z3_apply_result_dec_ref(Z3_context c, Z3_apply_result r) {
Z3_TRY;
LOG_Z3_apply_result_dec_ref(c, r);
RESET_ERROR_CODE();
if (r)
to_apply_result(r)->dec_ref();
Z3_CATCH;