gh-111178: fix UBSan failures in `Modules/_zoneinfo.c` by picnixz · Pull Request #129798 · python/cpython
Conversation
picnixz
marked this pull request as ready for review
Ah I'm sorry I put this one as ready for review but I learned that _ + capital letter was also UB (#128248 (comment)) so I'll fix them tomorrow.
picnixz
marked this pull request as ready for review
Comment on lines +59 to +60
| #define PyZoneInfo_ZoneInfo_FAST_CAST(op) ((PyZoneInfo_ZoneInfo *)(op)) | ||
| #define PyZoneInfo_ZoneInfo_CAST(op) PyZoneInfo_ZoneInfo_FAST_CAST(op) |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This deserves a comment.
Or replacing FAST_CAST uses with direct casts.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the fast cast macro but added a message in my commit saying that that raw casts don't need something else. I think I've only had fast cast macros when I was writing the date/time/tkinter PRs but I may have introduced that in other PR.
picnixz
deleted the
fix/ubsan/zoneinfo-111178
branch