Skip to content

[Exclusivity] Treat warning violations with reabstraction thunks as e… #15915

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

Conversation

devincoughlin
Copy link
Contributor

…rrors

In Swift 4.1 we fixed a false negative and started looking through
reabstraction thunks to statically find exclusivity violations. To lessen
source impact, we treated these violations as warnings. This commit upgrades
those warnings to errors.

rdar://problem/34669400

…rrors

In Swift 4.1 we fixed a false negative and started looking through
reabstraction thunks to statically find exclusivity violations. To lessen
source impact, we treated these violations as warnings. This commit upgrades
those warnings to errors.

rdar://problem/34669400
@devincoughlin
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - cef3139

@atrick
Copy link
Contributor

atrick commented Apr 13, 2018

@devincoughlin It looks like this corelibs PR needs to be merged first, and is ready to merge:
swiftlang/swift-corelibs-foundation#1512

Foundation/JSONEncoder.swift:369:16: error: overlapping accesses to 'self', but modification requires exclusive access; consider copying to a local variable

@devincoughlin
Copy link
Contributor Author

@swift-ci please test source compatibility

@devincoughlin
Copy link
Contributor Author

I only see two violations of the new diagnostics in the compatibility suite, both in the same function in NetService's Socket+Extensions

var buffer = Data(count: Int(INET6_ADDRSTRLEN)) let ptr = buffer.withUnsafeMutableBytes { inet_ntop(AF_INET, &sin.sin_addr, $0, socklen_t(buffer.count)) }
Here an appropriate fix is to copy the count of buffer outside of the closure and pass that to inet_ntop() instead.

@devincoughlin
Copy link
Contributor Author

And the reason the compatibility suite is passing even with this change is that NetService's 4.0 compatibility version is building in Swift 3 mode, where we still emit warnings even with this commit.

@devincoughlin
Copy link
Contributor Author

@swift-ci please test and merge

@devincoughlin
Copy link
Contributor Author

@swift-ci please test linux platform and merge

@devincoughlin
Copy link
Contributor Author

@swift-ci please test and merge

@devincoughlin
Copy link
Contributor Author

@swift-ci Please test and merge

@swift-ci swift-ci merged commit 91f8a75 into swiftlang:master Apr 16, 2018
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