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

Fix segfault for Weil polynomials #37861

Merged
merged 3 commits into from
May 12, 2024

Conversation

kedlaya
Copy link
Contributor

@kedlaya kedlaya commented Apr 24, 2024

Fix segfault for Weil polynomials

Eliminate a segfault that occurs when asking for Weil polynomials of degree 0 and sign -1 (which do not exist, so the iterator should return empty). This fixes #37860.

@roed314
Copy link
Contributor

roed314 commented Apr 24, 2024

LGTM.

@kedlaya
Copy link
Contributor Author

kedlaya commented Apr 25, 2024

I noticed there is also a segfault when the degree is negative. The root cause is passing a negative degree to dfs_manager, so I moved the check to catch both issues at once, and added a second doctest.

Copy link

Documentation preview for this PR (built with commit 95d8bea; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

Copy link
Collaborator

@tscrim tscrim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

vbraun pushed a commit to vbraun/sage that referenced this pull request May 11, 2024
    
Fix segfault for Weil polynomials

Eliminate a segfault that occurs when asking for Weil polynomials of
degree 0 and sign -1 (which do not exist, so the iterator should return
empty). This fixes sagemath#37860.
    
URL: sagemath#37861
Reported by: kedlaya
Reviewer(s): Travis Scrimshaw
vbraun pushed a commit to vbraun/sage that referenced this pull request May 12, 2024
    
Fix segfault for Weil polynomials

Eliminate a segfault that occurs when asking for Weil polynomials of
degree 0 and sign -1 (which do not exist, so the iterator should return
empty). This fixes sagemath#37860.
    
URL: sagemath#37861
Reported by: kedlaya
Reviewer(s): Travis Scrimshaw
@vbraun vbraun merged commit ee5f606 into sagemath:develop May 12, 2024
16 checks passed
@mkoeppe mkoeppe added this to the sage-10.4 milestone May 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

weil_polynomials
5 participants