Skip to content

Fix a CFI failure in __assume_aligned - #158

Merged
Algunenano merged 1 commit into
ClickHouse/release-23.xfrom
cfi-assume-aligned
Nov 17, 2026
Merged

Algunenano merged 1 commit into
ClickHouse/release-23.xfrom
cfi-assume-aligned

Conversation

@Algunenano

Copy link
Copy Markdown
Member

__assume_aligned casts the result of __builtin_assume_aligned back to _Tp*, and libc++ 23 calls it through __assume_valid_range with the end of a range (for example in find_if), which does not point to an object, so Clang CFI rejects the cast for polymorphic types. Mark it _LIBCPP_NO_CFI, as __get_elem is.

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]>
@Algunenano
Algunenano merged commit 6afdc58 into ClickHouse/release-23.x Nov 17, 2026
14 checks passed
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant