Skip to content

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.

@github-actions
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
sagemathgh-37861: Fix segfault for Weil polynomials
    
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
sagemathgh-37861: Fix segfault for Weil polynomials
    
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
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