-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[CSSimplify] Add a null check to guard against broken/missing `Expres… #36804
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
…sibleByNilLiteral` I couldn't come up with an isolated test-case to add to the suite, but it's possible that `getProtocol` returns `nullptr` for invalid or missing protocol so there has to be a check for that otherwise compiler is going to crash trying to access `getDeclaredType()`. Resolves: rdar://76187450
@swift-ci please smoke test macOS platform |
@swift-ci please smoke test Linux platform |
Is this the same bug as where the stdlib fails to load but we keep compiling? There are too many places in the compiler that rely on stdlib declarations being present, and we can't fix all of them. The right solution is to stop the build if the stdlib doesn't load. I believe @beccadax was working on this. |
@slavapestov I'm not sure if it is or not since I don't have access to log just the stacktrace of the crashed thread. |
Since #32091, we should bail early if the stdlib fails to load. |
So it's either something else or that code doesn't cover all the cases... |
Does the crash happen through the FrontendTool's |
@hamishknight |
@swift-ci please smoke test macOS platform |
We shouldn’t be doing anything special regarding stdlib loading. If your crash is related to the stdlib not being loaded (which I suspect), this should be caught by the check added in #36797. |
Good to know, @ahoppen! I still going to merge this null check just to feel better, I think other places in the solver should handle situations like that gracefully as well, in case there is some other edge case, crashing at random points isn’t great... |
Right, yeah SourceKit sets up its own |
…sibleByNilLiteral`
I couldn't come up with an isolated test-case to add to the suite,
but it's possible that
getProtocol
returnsnullptr
for invalidor missing protocol so there has to be a check for that otherwise
compiler is going to crash trying to access
getDeclaredType()
.Resolves: rdar://76187450