[PCH] When serializing an PseudoObjectExpr or AtomicExpr, the serialization code must be set
otherwise it will crash with asserts on or it will be written as null pointer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144626 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Serialization/ASTWriterStmt.cpp b/lib/Serialization/ASTWriterStmt.cpp
index e25a20b..e3311e9 100644
--- a/lib/Serialization/ASTWriterStmt.cpp
+++ b/lib/Serialization/ASTWriterStmt.cpp
@@ -753,6 +753,8 @@
if (OpaqueValueExpr *OVE = dyn_cast<OpaqueValueExpr>(*i))
Writer.AddStmt(OVE->getSourceExpr());
}
+
+ Code = serialization::EXPR_PSEUDO_OBJECT;
}
void ASTStmtWriter::VisitAtomicExpr(AtomicExpr *E) {
@@ -768,6 +770,8 @@
}
Writer.AddSourceLocation(E->getBuiltinLoc(), Record);
Writer.AddSourceLocation(E->getRParenLoc(), Record);
+
+ Code = serialization::EXPR_ATOMIC;
}
//===----------------------------------------------------------------------===//