-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
static_cast() of sentinel value in LLVM intrusive lists is Undefined Behavior #27127
Comments
assigned to @dexonsmith |
Just as an update since my last email, I have a plan for fixing this, but it's not safe until I've made the implicit conversion in MachineInstrBundleIterator explicit:template struct MachineInstrBundleIterator {
|
r276902
Finished that in r276902. I'll try figure out what's left when I'm back from vacation. |
I have patches locally that remove the inherent UB from iplist/ilist/ilist_node/ilist_iterator, with all tests passing (a few fixes to end()-dereferences required). Shouldn't be long now? |
Just sent a review to the list to fix this. |
A few follow-ups to do for cleanup, but this was fixed in r278974! I can't imagine anyone needs/wants to cherry-pick all of these (... just re-branch), but since I have them, this was: |
Extended Description
Many of our iplist classes (MachineBasicBlock, MemoryAccess) do something like this:
Because of iterators have pointers to
T
instead ofListNodeBase
, this exposes UB.See here for more details: http://lists.llvm.org/pipermail/llvm-dev/2015-October/091115.html
The text was updated successfully, but these errors were encountered: