3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-05-06 15:25:46 +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

@ -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;
}