-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[libc++] Fix strict aliasing violation for deque::const_iterator
#136067
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
Open
frederick-vs-ja
wants to merge
19
commits into
llvm:main
Choose a base branch
from
frederick-vs-ja:fix-deque-const_iterator
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
6080007
[libc++] Fix strict aliasing violation for `deque::const_iterator`
frederick-vs-ja c624455
Switch to use internally rebinding
frederick-vs-ja 02f54f2
Merge branch 'main' into fix-deque-const_iterator
frederick-vs-ja 1c1a4a9
`__conditional_t`
frederick-vs-ja bbaa690
Fix allocators and fancy pointers in `deque/abi.compile.pass.cpp`
frederick-vs-ja 0bb7fa0
Merge branch 'main' into fix-deque-const_iterator
frederick-vs-ja 94dbfb4
Make GCC happy
frederick-vs-ja 7a4eccd
Merge branch 'main' into fix-deque-const_iterator
frederick-vs-ja ba6007f
Make them meeting Cpp17NullablePointer
frederick-vs-ja 6aee963
Fix typo
frederick-vs-ja cedbf8a
`_LIBCPP_HIDE_FROM_ABI`
frederick-vs-ja 4c35ff7
Merge branch 'main' into fix-deque-const_iterator
frederick-vs-ja 08ffe3f
Merge branch 'main' into fix-deque-const_iterator
frederick-vs-ja ad7ff04
Merge branch 'main' into fix-deque-const_iterator
frederick-vs-ja a976380
Retarget LLVM22
frederick-vs-ja 56fcc31
Address review comments
frederick-vs-ja f375152
Merge branch 'main' into fix-deque-const_iterator
frederick-vs-ja 7b71efc
Merge branch 'main' into fix-deque-const_iterator
frederick-vs-ja bbc0125
Merge branch 'main' into fix-deque-const_iterator
frederick-vs-ja File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -110,6 +110,13 @@ ABI Affecting Changes | |||||||||||
| - The ABI flag ``_LIBCPP_ABI_NO_REVERSE_ITERATOR_SECOND_MEMBER`` has been split off from | ||||||||||||
| ``_LIBCPP_ABI_NO_ITERATOR_BASES``. If you are using this flag and care about ABI stability, you should set | ||||||||||||
| ``_LIBCPP_ABI_NO_REVERSE_ITERATOR_SECOND_MEMBER`` as well. | ||||||||||||
| - The ``const_iterator`` member type of ``std::deque`` is now corrected to hold a (possibly fancy) pointer to the | ||||||||||||
| (possibly fancy) pointer allocated in the internal map. E.g. when the allocators use fancy pointers, the internal map | ||||||||||||
| stores ``fancy_ptr<T>`` objects, and the previous strategy accessed these objects via ``const fancy_ptr<const T>`` | ||||||||||||
| lvalues, caused undefined behavior. Now ``const_iterator`` stores | ||||||||||||
| ``fancy_ptr<const fancy_ptr<T>>`` instead of ``fancy_ptr<const fancy_ptr<const T>>``, and ABI break can happen when | ||||||||||||
| such two types have incompatible layouts. This is necessary for reducing undefined behavior and ``constexpr`` support | ||||||||||||
| for ``deque`` in C++26, so we do not provide any way to opt-out of that behavior. | ||||||||||||
|
Comment on lines
+117
to
+119
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
But actually, talking with @philnik777 just now we aren't sure there's an ABI break at all anymore. Can you confirm that with the latest version of the patch, the intent is for there not to be any ABI break? |
||||||||||||
|
|
||||||||||||
| - The internal types ``__map_value_compare``, ``__unordered_map_hasher``, ``__unordered_map_equal``, | ||||||||||||
| ``__hash_map_hasher`` and ``__hash_map_equal`` have been refactored to use ``_LIBCPP_COMPRESSED_ELEMENT`` instead of | ||||||||||||
|
|
||||||||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.