Skip to content

[Wunsafe-buffer-usage] Fix false positive when const sized array is indexed by const evaluatable expressions (#119340) #9826

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
Jan 14, 2025

Conversation

malavikasamak
Copy link

Do not warn when constant sized array is indexed by expressions that evaluate to a const value. For instance, sizeof(T) expression value can be evaluated at compile time and if an array is indexed by such an expression, it's bounds can be validated.

(rdar://140320289)

Co-authored-by: MalavikaSamak [email protected]
(cherry picked from commit 64c2156)

…ndexed by const evaluatable expressions (llvm#119340)

Do not warn when constant sized array is indexed by expressions that
evaluate to a const value. For instance, sizeof(T) expression value can
be evaluated at compile time and if an array is indexed by such an
expression, it's bounds can be validated.

(rdar://140320289)

Co-authored-by: MalavikaSamak <[email protected]>
(cherry picked from commit 64c2156)
@malavikasamak malavikasamak requested a review from a team as a code owner January 14, 2025 04:54
@malavikasamak
Copy link
Author

@swift-ci test

@malavikasamak malavikasamak merged commit fdfa59e into stable/20240723 Jan 14, 2025
3 checks passed
@malavikasamak malavikasamak deleted the msamak-cherry-pick-fp-const-eval branch January 14, 2025 12:23
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.

1 participant