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

Sema: Fix crashes when a call of a closure value is missing a 'try' #21727

Merged

Conversation

@slavapestov
Copy link
Member

slavapestov commented Jan 9, 2019

Fixes rdar://problem/46973064.

slavapestov added 2 commits Jan 9, 2019
Two problems here:

- The InterpolatedString instance variable was not always initialized before
  being checked for null

- In the non-null case, we were assuming the result of CallExpr::getCalledValue()
  was non-null, but it's null if the callee is not a function declaration

Fixes <rdar://problem/46973064>.
@slavapestov slavapestov requested a review from brentdax Jan 9, 2019
@slavapestov

This comment has been minimized.

Copy link
Member Author

slavapestov commented Jan 9, 2019

@brentdax Can you review for 5.0? This is a string interpolation regression.

@slavapestov

This comment has been minimized.

Copy link
Member Author

slavapestov commented Jan 9, 2019

@swift-ci Please smoke test

Copy link
Contributor

brentdax left a comment

Looks good to me. What a silly little bug...

lib/Sema/TypeCheckError.cpp Show resolved Hide resolved
@slavapestov slavapestov merged commit 1e27f21 into apple:master Jan 9, 2019
2 checks passed
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
Projects
None yet
2 participants
You can’t perform that action at this time.