Skip to content

gh-133157: remove usage of _Py_NO_SANITIZE_UNDEFINED in pyexpat #134050

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

picnixz
Copy link
Member

@picnixz picnixz commented May 15, 2025

IIUC ISO C11, we can use "union casts" (which are actually compound literals, and thus constructors) to pass use unions. The idea is to consider each different function pointer as a union of possible function pointers and store them as such. In some sense, we're doing singledispatch with known registered types.

@picnixz

This comment was marked as resolved.

@picnixz picnixz marked this pull request as draft May 15, 2025 13:09
@picnixz

This comment was marked as resolved.

@picnixz
Copy link
Member Author

picnixz commented May 15, 2025

Hum, looks like it worked. But I don't know why the pointer alternative didn't work (in clang it does?). I guess it's because of some optimization and it got eliminated (or maybe what I did was also a UB c:)

@picnixz picnixz marked this pull request as ready for review May 15, 2025 13:52
@picnixz picnixz requested a review from vstinner May 15, 2025 15:31
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.

2 participants