Skip to content

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented Feb 14, 2020

Cherry-pick of #29816 into swift-5.2-branch

Explanation: Fix a crash in context type analysis for IfExpr (ternary expression) in code completions. Before sequence folding, IfExpr doesn't have the condition part. When they somehow aren't type checked prior to the code completion analysis, it used to crash because of the lack of the nullptr check.
Scope: Code completion inside "then" part of ternary expressions.
Risk: Very low. Just add a check to guard.
Issue: rdar://problem/59344203
Testing: Passed the current regression test. (No additional test because I haven't been able to find a reproducer)
Reviewer: Nathan Hawes (@nathawes)

'IfExpr' (ternary expression) does not have condition part before
sequence folding. Add a guard to avoid a crash.

rdar://problem/59344203
(cherry picked from commit 9cb2c05)
@rintaro rintaro requested a review from a team as a code owner February 14, 2020 00:03
@rintaro
Copy link
Member Author

rintaro commented Feb 14, 2020

@swift-ci Please test

@rintaro
Copy link
Member Author

rintaro commented Feb 14, 2020

@swift-ci Please nominate

@rintaro rintaro changed the title [CodeCompletion] Fix a crash in context type analysis [5.2][CodeCompletion] Fix a crash in context type analysis Feb 14, 2020
@rintaro rintaro merged commit 4710633 into swiftlang:swift-5.2-branch Feb 14, 2020
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.

2 participants