-
Notifications
You must be signed in to change notification settings - Fork 42
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
Emit an error instead of crashing on invalid use of __capability #704
Merged
arichardson
merged 3 commits into
CTSRD-CHERI:dev
from
arichardson:require-cheri-for-__capability
Jul 6, 2023
Merged
Emit an error instead of crashing on invalid use of __capability #704
arichardson
merged 3 commits into
CTSRD-CHERI:dev
from
arichardson:require-cheri-for-__capability
Jul 6, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
arichardson
commented
Jun 21, 2023
arichardson
force-pushed
the
require-cheri-for-__capability
branch
from
June 30, 2023 20:03
f274b26
to
a7a2189
Compare
I've moved the check to a more sensible location and filed #706 to fix this properly. I think we should still merge this to avoid crashes that are easily triggered by users. |
jrtc27
reviewed
Jun 30, 2023
arichardson
force-pushed
the
require-cheri-for-__capability
branch
from
July 5, 2023 18:28
a7a2189
to
7092f79
Compare
jrtc27
reviewed
Jul 5, 2023
Minor readability nit otherwise LGTM (Re attribute vs qualifier, I would care were it not for the TODO, but not worth getting right for code that should be removed in future) |
Previously, attempting to generate code that contained __capability while using a target without support for CHERI would assert with `Assertion `llvm::isPowerOf2_32(Align) && "Alignment must be power of 2"' failed.` Fix this by emitting a more user-friendly error message instead of crashing when we encounter __capability but CHERI is not supported. Ideally we would not expose the keyword for non-CHERI but that is a rather more invasive change.
Also drop the second non-reduced test for the same issue.
arichardson
force-pushed
the
require-cheri-for-__capability
branch
from
July 6, 2023 17:19
7092f79
to
1f044f6
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Emit an error instead of crashing on invalid use of __capability
Previously, attempting to generate code that contained __capability while
using a target without support for CHERI would assert with
Assertion
llvm::isPowerOf2_32(Align) && "Alignment must be power of 2"' failed.`Fix this by emitting a more user-friendly error message instead of crashing
when we encounter __capability but CHERI is not supported.
Ideally we would not expose the keyword for non-CHERI but that is a
rather more invasive change.