Repository navigation
Fix a CFI failure in __assume_aligned - #158
Merged
Merged
Conversation
It casts the result of __builtin_assume_aligned back to _Tp*, and __assume_valid_range passes it the end of a range, which does not point to an object, so Clang CFI (cfi-unrelated-cast) rejects the cast when _Tp is polymorphic. Co-Authored-By: Claude Opus 5.5 <[email protected]>
thevar1able
added a commit
to ClickHouse/ClickHouse
that referenced
this pull request
Nov 17, 2026
Brings ClickHouse/llvm-project#158 (exempt `__assume_aligned` from Clang CFI). PR: #109239 Co-Authored-By: Claude Opus 5.5 <[email protected]>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
__assume_alignedcasts the result of__builtin_assume_alignedback to_Tp*, and libc++ 23 calls it through__assume_valid_rangewith the end of a range (for example infind_if), which does not point to an object, so Clang CFI rejects the cast for polymorphic types. Mark it_LIBCPP_NO_CFI, as__get_elemis.