Skip to content

Commit 4710633

Browse files
authored
Merge pull request #29829 from rintaro/5.2-ide-completion-rdar59344203
[5.2][CodeCompletion] Fix a crash in context type analysis
2 parents c6be728 + adb56f3 commit 4710633

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/IDE/ExprContextAnalysis.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,8 @@ class ExprContextAnalyzer {
645645
}
646646
case ExprKind::If: {
647647
auto *IE = cast<IfExpr>(Parent);
648-
if (SM.rangeContains(IE->getCondExpr()->getSourceRange(),
648+
if (IE->isFolded() &&
649+
SM.rangeContains(IE->getCondExpr()->getSourceRange(),
649650
ParsedExpr->getSourceRange())) {
650651
recordPossibleType(Context.getBoolDecl()->getDeclaredInterfaceType());
651652
break;

0 commit comments

Comments
 (0)