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

[libc++] std::unreachable should probably trap in some hardening modes #67732

Open
ldionne opened this issue Sep 28, 2023 · 1 comment · May be fixed by #109732
Open

[libc++] std::unreachable should probably trap in some hardening modes #67732

ldionne opened this issue Sep 28, 2023 · 1 comment · May be fixed by #109732
Assignees
Labels
hardening Issues related to the hardening effort libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.

Comments

@ldionne
Copy link
Member

ldionne commented Sep 28, 2023

I am not certain which modes yet, but since std::unreachable invokes UB and we want to catch UB, it would make sense to guarantee a trap there when we are in some hardening modes (e.g. certainly in the debug mode).

@ldionne ldionne added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Sep 28, 2023
@philnik777 philnik777 added the hardening Issues related to the hardening effort label Sep 28, 2023
@shafik
Copy link
Collaborator

shafik commented Sep 28, 2023

It would be nice if we could fix the more general problem: #48943

Also see: https://discourse.llvm.org/t/can-we-keep-must-progress-optimizations-around-infinite-loop-in-c-while-avoiding-some-surprising-behavior/69205/1

I realize that is much wider scope but just wanted to put it out there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hardening Issues related to the hardening effort libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants