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

Sema: Fix a failure to emit a diagnostic #12149

Merged
merged 1 commit into from Sep 28, 2017

Conversation

Projects
None yet
2 participants
@slavapestov
Copy link
Member

slavapestov commented Sep 27, 2017

CSDiag was misinterpreting the result of checkGenericArguments().

A result of SubstitutionFailure does not mean a diagnostic was
emitted, only a result of Failure means that. This fixes a case
where we did not emit a diagnostic, result in a crash on invalid.

The diagnostic is still poor, but that's better than crashing.

Fixes https://bugs.swift.org/browse/SR-5932,
rdar://problem/34522739.

@slavapestov

This comment has been minimized.

Copy link
Member

slavapestov commented Sep 27, 2017

@swift-ci Please smoke test

@xedin

xedin approved these changes Sep 27, 2017

Copy link
Member

xedin left a comment

Thanks!

Sema: Fix a failure to emit a diagnostic
CSDiag was misinterpreting the result of checkGenericArguments().

A result of SubstitutionFailure does not mean a diagnostic was
emitted, only a result of Failure means that. This fixes a case
where we did not emit a diagnostic, result in a crash on invalid.

The diagnostic is still poor, but that's better than crashing.

Fixes <https://bugs.swift.org/browse/SR-5932>,
<rdar://problem/34522739>.

@slavapestov slavapestov force-pushed the slavapestov:csdiag-is-terrible branch to 044af75 Sep 27, 2017

@slavapestov

This comment has been minimized.

Copy link
Member

slavapestov commented Sep 27, 2017

This resolves the reduced crasher that @rudkx added for https://bugs.swift.org/browse/SR-5836 as well.

@slavapestov

This comment has been minimized.

Copy link
Member

slavapestov commented Sep 27, 2017

@swift-ci Please smoke test

2 similar comments
@slavapestov

This comment has been minimized.

Copy link
Member

slavapestov commented Sep 27, 2017

@swift-ci Please smoke test

@slavapestov

This comment has been minimized.

Copy link
Member

slavapestov commented Sep 27, 2017

@swift-ci Please smoke test

@slavapestov slavapestov merged commit 901cbde into apple:master Sep 28, 2017

2 checks passed

Swift Test Linux Platform (smoke test)
Details
Swift Test OS X Platform (smoke test)
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment