8000 [BoundsSafety] Fix dynamic-count-invalid-rhs.c test (NFC) by patrykstefanski · Pull Request #10871 · swiftlang/llvm-project · GitHub
[go: up one dir, main page]

Skip to content

[BoundsSafety] Fix dynamic-count-invalid-rhs.c test (NFC) #10871

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

Merged
merged 1 commit into from
Jun 24, 2025

Conversation

patrykstefanski
Copy link

Since recently, Clang does not attach an invalid statement to function body. In the modified test, the function body won't have p3->len = asdf; statement. This makes our dynamic count pointer assignment analysis think that the assignment to p3->len is missing.

We could check Sema::hasAnyUnrecoverableErrorsInThisFunction() and not run our analysis if there is any error. But, we still want to diagnose problems in other blocks. I am not sure if there is a good way to check if a given block has already any unrecoverable error.

rdar://153756387

Since recently, Clang does not attach an invalid statement to function
body.  In the modified test, the function body won't have
`p3->len = asdf;` statement. This makes our dynamic count pointer
assignment analysis think that the assignment to `p3->len` is missing.

We could check `Sema::hasAnyUnrecoverableErrorsInThisFunction()` and not
run our analysis if there is any error. But, we still want to diagnose
problems in other blocks. I am not sure if there is a good way to check
if a given block has already any unrecoverable error.

rdar://153756387
@patrykstefanski patrykstefanski added the clang:bounds-safety Issue relating to the experimental -fbounds-safety feature in Clang label Jun 18, 2025
@patrykstefanski
Copy link
Author

@swift-ci test llvm

@rapidsna
Copy link

Merging it to unblock CI.

@patrykstefanski Could you please file another radar to track this usability issue caused by Clang recently not attaching an invalid statement to function body?

@rapidsna rapidsna merged commit 487fbbd into next Jun 24, 2025
2 checks passed
@rapidsna rapidsna deleted the eng/pstefanski/PR-153756387 branch June 24, 2025 05:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:bounds-safety Issue relating to the experimental -fbounds-safety feature in Clang
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0