For every Z3 API call, apigen.py generates a Z3_get_error_code(ctx) check right after the call. However, I just learned the hard way that not every Z3 API touches the error code. For example, solver_dec_ref() doesn't. In particular, it doesn't even reset it. So this:
For every Z3 API call,
apigen.py
generates aZ3_get_error_code(ctx)
check right after the call. However, I just learned the hard way that not every Z3 API touches the error code. For example,solver_dec_ref()
doesn't. In particular, it doesn't even reset it. So this:will die inside Z3Solver>>release because it will think
solver_dec_ref()
failed when if fact it just didn't clean up the leftover error code.