-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set the default error handler to None #92
Conversation
In the C++ bindings, null is passed. https://github.com/Z3Prover/z3/blob/141edef0d64796fd387ec2f8efe796a7329c48e2/src/api/c%2B%2B/z3%2B%2B.h#L167 In the ML, Python, and C# bindings, a pointer to a noop function are passed instead, to the same effect. https://github.com/Z3Prover/z3/blob/141edef0d64796fd387ec2f8efe796a7329c48e2/src/api/ml/z3native_stubs.c.pre#L448 https://github.com/Z3Prover/z3/blob/141edef0d64796fd387ec2f8efe796a7329c48e2/src/api/python/z3/z3.py#L187 https://github.com/Z3Prover/z3/blob/141edef0d64796fd387ec2f8efe796a7329c48e2/src/api/dotnet/Context.cs#L4627
Can you describe what happens now when |
|
So would that lead to UB with the current patch, which always returns a
Yes, I think this would be preferable. |
One issue is that Z3_model is defined in z3-sys as pub type Z3_model = *mut _Z3_model; so don't think it can be made into non-null without changing bindgen. Another option would be to panic if |
We wouldn't change the |
One issue with this is that this would be semver breaking since it changes function signatures vs panicking if we get null. |
Releasing a new breaking version isn't a big deal. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
In other language bindings, after constructing the context the error handler is set to null/a noop. This should fix #69 .
In the C++ bindings, null is passed.
https://github.com/Z3Prover/z3/blob/141edef0d64796fd387ec2f8efe796a7329c48e2/src/api/c%2B%2B/z3%2B%2B.h#L167
In the ML, Python, and C# bindings, a pointer to a noop function are
passed instead, to the same effect.
https://github.com/Z3Prover/z3/blob/141edef0d64796fd387ec2f8efe796a7329c48e2/src/api/ml/z3native_stubs.c.pre#L448
https://github.com/Z3Prover/z3/blob/141edef0d64796fd387ec2f8efe796a7329c48e2/src/api/python/z3/z3.py#L187
https://github.com/Z3Prover/z3/blob/141edef0d64796fd387ec2f8efe796a7329c48e2/src/api/dotnet/Context.cs#L4627