]> granicus.if.org Git - clang/commitdiff
[PCH] When serializing an PseudoObjectExpr or AtomicExpr, the serialization code...
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Tue, 15 Nov 2011 06:20:27 +0000 (06:20 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Tue, 15 Nov 2011 06:20:27 +0000 (06:20 +0000)
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

lib/Serialization/ASTWriterStmt.cpp
test/PCH/objc_exprs.h

index e25a20b3532386c7884320576b22d6f933b4133f..e3311e9d907300f57eb572c57357227e852986f4 100644 (file)
@@ -753,6 +753,8 @@ void ASTStmtWriter::VisitPseudoObjectExpr(PseudoObjectExpr *E) {
     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 @@ void ASTStmtWriter::VisitAtomicExpr(AtomicExpr *E) {
   }
   Writer.AddSourceLocation(E->getBuiltinLoc(), Record);
   Writer.AddSourceLocation(E->getRParenLoc(), Record);
+
+  Code = serialization::EXPR_ATOMIC;
 }
 
 //===----------------------------------------------------------------------===//
index b811430c2e8967f7d6e5c78094dd84d21aa02f53..807304c20f86609fa08adad5a9f80ddb7570c3b3 100644 (file)
@@ -16,3 +16,11 @@ typedef typeof(id<foo>) objc_id_protocol_ty;
 
 typedef typeof(itf*) objc_interface_ty;
 typedef typeof(itf<foo>*) objc_qual_interface_ty;
+
+@interface PP
+@property (assign) id prop;
+@end
+
+static inline id getPseudoObject(PP *p) {
+    return p.prop;
+}