[PATCH] Fix crash when serializing ObjCIvarDecl.

Yiding Jia yiding at fb.com
Fri Jun 20 18:58:17 PDT 2014


add a test

http://reviews.llvm.org/D4239

Files:
  lib/Serialization/ASTWriterDecl.cpp
  test/Index/index-pch-objc.m

Index: lib/Serialization/ASTWriterDecl.cpp
===================================================================
--- lib/Serialization/ASTWriterDecl.cpp
+++ lib/Serialization/ASTWriterDecl.cpp
@@ -1515,8 +1515,6 @@
   // ObjC Ivar
   Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // getAccessControl
   Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // getSynthesize
-  // getBackingIvarReferencedInAccessor
-  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
   // Type Source Info
   Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
   Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
Index: test/Index/index-pch-objc.m
===================================================================
--- /dev/null
+++ test/Index/index-pch-objc.m
@@ -0,0 +1,10 @@
+// RUN: c-index-test -write-pch %t.pch %s
+// RUN: env LIBCLANG_NOTHREADS=1 c-index-test -index-tu %t.pch | FileCheck %s
+
+ at interface SomeClass
+ at property (retain) id foo;
+ at end
+ at implementation SomeClass
+ at end
+
+// CHECK: [indexDeclaration]: kind: objc-ivar | name: _foo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D4239.10717.patch
Type: text/x-patch
Size: 1045 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140621/7e37b0a9/attachment.bin>


More information about the cfe-commits mailing list