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

[BoundsSafety] Cherry pick apinotes from stable/20240723 #10028

Open
wants to merge 3 commits into
base: next
Choose a base branch
from

Conversation

hnrklssn
Copy link

No description provided.

hnrklssn and others added 3 commits February 13, 2025 14:54
This adds support for annotating function parameters with __counted_by, __sized_by, __counted_by_or_null, __sized_by_or_null, and __ended_by, using API notes. The main content of handlePtrCountedByEndedByAttr is extracted to applyPtrCountedByEndedByAttr and decoupled from ParsedAttr. The helper function ParseBoundsAttributeArgFromString is added to make it possible to parse count expressions from SemaAPINotes.

The current implementation of __terminated_by/__null_terminated makes it harder to extract from the iterative type processing, but since it doesn't require any extra context to parse the attribute, it can be applied using the normal Type override instead.

rdar://139830881
(cherry picked from commit da945ea)
rdar://143701027
(cherry picked from commit 013acca)
These test cases use clang modules. TypeCoupledDeclRefInfo
serialization/deserialization is currently broken on Linux, so disable
these tests until it's been resolved.

(cherry picked from commit 9fbb19c)
@hnrklssn hnrklssn requested a review from rapidsna February 14, 2025 00:45
@hnrklssn
Copy link
Author

@swift-ci please test llvm

@hnrklssn
Copy link
Author

@swift-ci please test llvm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants