aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/PCHReaderStmt.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Frontend/PCHReaderStmt.cpp')
-rw-r--r--lib/Frontend/PCHReaderStmt.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Frontend/PCHReaderStmt.cpp b/lib/Frontend/PCHReaderStmt.cpp
index 6b97e610f5..3040a52260 100644
--- a/lib/Frontend/PCHReaderStmt.cpp
+++ b/lib/Frontend/PCHReaderStmt.cpp
@@ -194,6 +194,10 @@ unsigned PCHStmtReader::VisitSwitchStmt(SwitchStmt *S) {
PrevSC->setNextSwitchCase(SC);
else
S->setSwitchCaseList(SC);
+
+ // Retain this SwitchCase, since SwitchStmt::addSwitchCase() would
+ // normally retain it (but we aren't calling addSwitchCase).
+ SC->Retain();
PrevSC = SC;
}
return 2;