-
Notifications
You must be signed in to change notification settings - Fork 364
Fix UB in pops.c #206
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 UB in pops.c #206
Conversation
It is undefined behaviour to construct a pointer that is out-of-bounds, not just to use it. Commited in mimalloc-bench: daanx/mimalloc-bench@b517ae3
{ | ||
register precision w; | ||
register cacheType *kludge = pcache + size; /* for shitty compilers */ | ||
register cacheType *kludge; /* for shitty compilers */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I realize you are just modifying an existing line of code w/ the comment but I don't believe this comment lines up w/ our CoC and so I think a drive by edit is called for here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just a cherry-pick of daanx/mimalloc-bench@b517ae3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can put it into description or title
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, cherry-pick makes reader to expect an exact copy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MultiSource is a bit of an odd one in that we're pulling in source from other projects; we usually try to keep modifications to that source small so that we don't run into more painful merges later. In that regard, the comment is "fine" to leave in because it's not our source. That said, the comment is certainly inappropriate and we don't update sources particularly often, so a merge conflict would not be a deal-breaker here.
I think a drive-by edit would be fine, I also think leaving the comment wouldn't be the end of the world.
It is undefined behaviour to construct a pointer that is out-of-bounds, not just to use it.
Cherry-pick of commit in mimalloc-bench:
daanx/mimalloc-bench@b517ae3