This is an archive of the discontinued LLVM Phabricator instance.

[libc++]Declaring '__asign_view__' as a non noexcept function
ClosedPublic

Authored by Ris-Bali on Aug 25 2023, 2:36 AM.

Details

Summary

__assign_view__ is declared as a noexcept function in libcxx/include/__filesystem/path.h however internally it calls std::basic_string<char>::basic_string<char>(std::string_view) which is not a noexcept function this may lead to a std::terminate() call when allocation of a new string fails.

Fixes : https://github.com/llvm/llvm-project/issues/64858

Diff Detail

Event Timeline

Ris-Bali created this revision.Aug 25 2023, 2:36 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 25 2023, 2:36 AM
Ris-Bali requested review of this revision.Aug 25 2023, 2:36 AM
Herald added a reviewer: Restricted Project. · View Herald TranscriptAug 25 2023, 2:36 AM
Ris-Bali edited the summary of this revision. (Show Details)Aug 25 2023, 2:38 AM
Ris-Bali removed a reviewer: Restricted Project.
Ris-Bali removed a project: Restricted Project.
Herald added a reviewer: Restricted Project. · View Herald TranscriptAug 25 2023, 2:38 AM
Herald added a project: Restricted Project. · View Herald Transcript
Ris-Bali retitled this revision from Declaring '__asign_view__' as a non noexcept function to [libc++]Declaring '__asign_view__' as a non noexcept function .Aug 25 2023, 2:40 AM
Mordante accepted this revision.Aug 25 2023, 9:07 AM
Mordante removed a reviewer: cor3ntin.

Thanks for your contribution, LGTM!

FYI @cor3ntin works on Clang not on libc++.

Can you update the commit message with a link to the bug fixed?

If you want somebody to commit this patch on your behalf can you provide your name and e-mail address?

This revision is now accepted and ready to land.Aug 25 2023, 9:07 AM
Ris-Bali edited the summary of this revision. (Show Details)Aug 25 2023, 9:16 AM
Ris-Bali added a comment.EditedAug 25 2023, 9:20 AM

Name: Rishabh Bali
email: rishabhsbali@gmail.com
Github username: Ris-Bali

Thanks.

This revision was automatically updated to reflect the committed changes.