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

TRY Revert "[ASan][libc++] Initialize __r_ variable with lambda" #78646

Closed
wants to merge 1 commit into from

Conversation

vitalybuka
Copy link
Collaborator

Reverts #77394

@vitalybuka vitalybuka requested a review from a team as a code owner January 18, 2024 23:42
@llvmbot llvmbot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Jan 18, 2024
@llvmbot
Copy link
Collaborator

llvmbot commented Jan 18, 2024

@llvm/pr-subscribers-libcxx

Author: Vitaly Buka (vitalybuka)

Changes

Reverts llvm/llvm-project#77394


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

1 Files Affected:

  • (modified) libcxx/include/string (+1-1)
diff --git a/libcxx/include/string b/libcxx/include/string
index 4116f350a80476..ecafb80a79a3a2 100644
--- a/libcxx/include/string
+++ b/libcxx/include/string
@@ -921,7 +921,7 @@ public:
       // Turning off ASan instrumentation for variable initialization with _LIBCPP_STRING_INTERNAL_MEMORY_ACCESS
       // does not work consistently during initialization of __r_, so we instead unpoison __str's memory manually first.
       // __str's memory needs to be unpoisoned only in the case where it's a short string.
-      : __r_([](basic_string &__s) -> decltype(__s.__r_)&& { if(!__s.__is_long()) __s.__annotate_delete(); return std::move(__s.__r_); }(__str)) {
+      : __r_(((__str.__is_long() ? 0 : (__str.__annotate_delete(), 0)), std::move(__str.__r_))) {
     __str.__r_.first() = __rep();
     __str.__annotate_new(0);
     if (!__is_long())

@ldionne
Copy link
Member

ldionne commented Jan 22, 2024

@vitalybuka Does this still serve a purpose being open?

@ldionne
Copy link
Member

ldionne commented Jan 23, 2024

I'll tentatively close, please reopen if this serves a purpose. I think it's safe to close since the short string annotations have landed and issues have been handled.

@ldionne ldionne closed this Jan 23, 2024
@vitalybuka
Copy link
Collaborator Author

Thanks, that's not needed anymore.

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.

3 participants