]> granicus.if.org Git - clang/commitdiff
Fix a crash during meta-data generation of objc2's nonfragile abi.
authorFariborz Jahanian <fjahanian@apple.com>
Fri, 20 Mar 2009 20:48:19 +0000 (20:48 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Fri, 20 Mar 2009 20:48:19 +0000 (20:48 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67402 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGObjCMac.cpp
test/CodeGenObjC/forward-class-impl-metadata.m [new file with mode: 0644]

index d3661e65db5db019ba91e38bf0fe92652ce36d0a..e14a58af4cb278625fa13bf40fc21390c9af0a6e 100644 (file)
@@ -4193,7 +4193,10 @@ void CGObjCNonFragileABIMac::GenerateClass(const ObjCImplementationDecl *ID) {
       ID->getClassInterface()->getSuperClass()->getNameAsString();
     SuperClassGV = GetClassGlobal(ObjCClassName + RootClassName);
   }
-  
+  // FIXME: Gross
+  ObjCInterfaceDecl *Interface =
+    const_cast<ObjCInterfaceDecl*>(ID->getClassInterface()); 
+  CGM.getTypes().ConvertType(CGM.getContext().buildObjCInterfaceType(Interface));
   InstanceStart = InstanceSize = 0;
   if (ObjCInterfaceDecl *OID = 
       const_cast<ObjCInterfaceDecl*>(ID->getClassInterface())) {
diff --git a/test/CodeGenObjC/forward-class-impl-metadata.m b/test/CodeGenObjC/forward-class-impl-metadata.m
new file mode 100644 (file)
index 0000000..c502aa4
--- /dev/null
@@ -0,0 +1,24 @@
+// RUN: clang -triple x86_64-unknown-unknown -emit-llvm -o %t %s
+
+@interface BASE  {
+@private
+    void* _reserved;
+}
+@end
+
+@class PVR;
+
+@interface PVRHandldler 
+{
+          PVR *_imageBrowser;
+}
+@end
+
+@implementation PVRHandldler @end
+
+
+@interface PVR   : BASE
+@end
+
+@implementation PVR
+@end