Skip to content
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

segmentation fault in recAddDefinition #5484

Closed
pcarbonn opened this issue Aug 16, 2021 · 1 comment
Closed

segmentation fault in recAddDefinition #5484

pcarbonn opened this issue Aug 16, 2021 · 1 comment

Comments

@pcarbonn
Copy link
Contributor

The following program results in a segmentation fault with Z3 4.8.12.0:

from z3 import *

f = Function('f', IntSort(), IntSort())
n = Int('n')
RecAddDefinition(f, n, If(n == 0, 1, 2))

A workaround is to use RecFunction (instead of Function) to declare f, even though it is not recursive. A possible fix would be to add an addFunction to the API, for non-recursive functions.

NikolajBjorner added a commit that referenced this issue Aug 16, 2021
@NikolajBjorner
Copy link
Contributor

Fixed the crash with an exception and a message.
Use RecFunction when a function is later going to be used in a recursive function definition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants