Details
Description
Quoting https://codereview.qt-project.org/c/qt/qtbase/+/497361/comment/08c2108e_11340ef4/ :
Either d or typeAndFlags are the active member. We read d and isSlowPath() reads typeAndFlags. So a compiler can legitimately conclude that lhs.d must always be == rhs.d because reading typeAndFlags after asserting (by reading it) that d is the active member would be UB and cannot happen.
While the above is about operator== specifically, I expect much of the class to have the same issue.
Acceptance criteria:
- the union d/typeAndFlags is gone and replaced by a non-variant member and manual bit-fiddling
Attachments
For Gerrit Dashboard: QTBUG-116821 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
502617,8 | IPC: Remove the "small" object optimization in QNativeIpcKey | dev | qt/qtbase | Status: MERGED | +2 | 0 |
504516,2 | IPC: Remove the "small" object optimization in QNativeIpcKey | 6.6 | qt/qtbase | Status: MERGED | +2 | 0 |
504549,2 | IPC: Remove the "small" object optimization in QNativeIpcKey | 6.6.0 | qt/qtbase | Status: MERGED | +2 | 0 |