Skip to content

Conversation

@ziqingluo-90
Copy link

In -Wunsafe-buffer-usage, many safe pattern checks can benefit from
constant folding. This commit improves null-terminated pointer checks by
folding conditional expressions.

rdar://159374822

Conflicts:
clang/lib/Analysis/UnsafeBufferUsage.cpp

(cherry picked from commit 4058751)

 Conflicts:
	clang/lib/Analysis/UnsafeBufferUsage.cpp

(cherry picked from commit 4058751)
@ziqingluo-90 ziqingluo-90 requested a review from a team as a code owner November 18, 2025 23:18
@ziqingluo-90
Copy link
Author

@swift-ci test llvm

@ziqingluo-90
Copy link
Author

@swift-ci test

1 similar comment
@ziqingluo-90
Copy link
Author

@swift-ci test

Copy link

@steakhal steakhal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure how did clang/lib/Analysis/UnsafeBufferUsage.cpp have a conflict, but the pick LGTM.
From what I've seen the hunk context should be the same.

@ziqingluo-90
Copy link
Author

ziqingluo-90 commented Nov 19, 2025

I'm not sure how did clang/lib/Analysis/UnsafeBufferUsage.cpp have a conflict, but the pick LGTM. From what I've seen the hunk context should be the same.

@steakhal We have Bounds Safety/C++ Safe Buffers interop code here but not upstream because Bounds Safety is not in upstream yet.

@ziqingluo-90
Copy link
Author

@swift-ci test macOS

@ziqingluo-90
Copy link
Author

@swift-ci test Windows

@ziqingluo-90
Copy link
Author

@swift-ci test macOS

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.

3 participants