Skip to content
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

Fix typeinfo for undefined sanitizer #121228

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion libcxx/include/typeinfo
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,9 @@ public:

_LIBCPP_HIDE_FROM_ABI size_t hash_code() const _NOEXCEPT { return __impl::__hash(__type_name); }

_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bool operator==(const type_info& __arg) const _NOEXCEPT {
// We need to inline this code because otherwise we will get a stack overflow with undefined sanitizer.
_LIBCPP_HIDE_FROM_ABI _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR_SINCE_CXX23 bool
operator==(const type_info& __arg) const _NOEXCEPT {
// When evaluated in a constant expression, both type infos simply can't come
// from different translation units, so it is sufficient to compare their addresses.
if (__libcpp_is_constant_evaluated()) {
Expand Down
Loading