-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
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
base: main
Are you sure you want to change the base?
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
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:) |
@encukou Could you have a look at this one please? I don't have a better alternative than using hacky unions (though it's a recommended construction as per ISO C11) |
aac33de
to
a4cf579
Compare
I think this could be simpler, see #135346. But I might be missing something. |
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.