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

[clang][lex] Fix non-portability diagnostics with absolute path (#74782) #7900

Merged

Conversation

jansvoboda11
Copy link

The existing code incorrectly assumes that Path can be empty. It can't, it always contains at least < or ". On Unix, this patch fixes an incorrect diagnostics that instead of "/Users/blah" suggested "Userss/blah". In assert builds, this would outright crash.

This patch also fixes a bug on Windows that would prevent the diagnostic being triggered due to separator mismatch.

rdar://91172342
(cherry picked from commit f0691bc)

…#74782)

The existing code incorrectly assumes that `Path` can be empty. It
can't, it always contains at least `<` or `"`. On Unix, this patch fixes
an incorrect diagnostics that instead of `"/Users/blah"` suggested
`"Userss/blah"`. In assert builds, this would outright crash.

This patch also fixes a bug on Windows that would prevent the diagnostic
being triggered due to separator mismatch.

rdar://91172342
(cherry picked from commit f0691bc)
@jansvoboda11
Copy link
Author

@swift-ci please test

@jansvoboda11 jansvoboda11 merged commit 8be112b into stable/20230725 Dec 19, 2023
3 checks passed
@jansvoboda11 jansvoboda11 deleted the jan_svoboda/stable-20230725-case-mismatch-fix branch December 19, 2023 01:24
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