Skip to content

[libc++] Add _LIBCPP_NO_CFI to __allocate_unique_temporary_buffer #109682

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

Merged
merged 1 commit into from
Sep 24, 2024

Conversation

frederick-vs-ja
Copy link
Contributor

Follows up #100914. Addresses the issue revealed in #100914 (comment).

Verified

This commit was signed with the committer’s verified signature. The key has expired.
nhooyr Anmol Sethi
@frederick-vs-ja frederick-vs-ja requested a review from a team as a code owner September 23, 2024 16:08
@llvmbot llvmbot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Sep 23, 2024
@llvmbot
Copy link
Member

llvmbot commented Sep 23, 2024

@llvm/pr-subscribers-libcxx

Author: A. Jiang (frederick-vs-ja)

Changes

Follows up #100914. Addresses the issue revealed in #100914 (comment).


Full diff: https://github.com/llvm/llvm-project/pull/109682.diff

1 Files Affected:

  • (modified) libcxx/include/__memory/unique_temporary_buffer.h (+1-1)
diff --git a/libcxx/include/__memory/unique_temporary_buffer.h b/libcxx/include/__memory/unique_temporary_buffer.h
index b9e2a47332682f..001254e8fa4be1 100644
--- a/libcxx/include/__memory/unique_temporary_buffer.h
+++ b/libcxx/include/__memory/unique_temporary_buffer.h
@@ -47,7 +47,7 @@ template <class _Tp>
 using __unique_temporary_buffer = unique_ptr<_Tp, __temporary_buffer_deleter<_Tp> >;
 
 template <class _Tp>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 __unique_temporary_buffer<_Tp>
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_NO_CFI _LIBCPP_CONSTEXPR_SINCE_CXX23 __unique_temporary_buffer<_Tp>
 __allocate_unique_temporary_buffer(ptrdiff_t __count) {
   using __deleter_type       = __temporary_buffer_deleter<_Tp>;
   using __unique_buffer_type = __unique_temporary_buffer<_Tp>;

Copy link
Contributor

@nico nico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! LG (but I'm not a code owner here, so you'll need an actual LG too).

Since get_temporary_buffer is going away anyways, it's probably not worth removing the _LIBCPP_NO_CFI there.

@ldionne
Copy link
Member

ldionne commented Sep 23, 2024

Would it make sense to add a CFI-sanitized CI job?

@frederick-vs-ja frederick-vs-ja merged commit fd11c81 into llvm:main Sep 24, 2024
10 of 14 checks passed
@frederick-vs-ja frederick-vs-ja deleted the tmp-buffer-cfi branch September 24, 2024 01:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants