Author: fjahanian
Date: Tue May 27 13:26:09 2014
New Revision: 209672

URL: http://llvm.org/viewvc/llvm-project?rev=209672&view=rev
Log:
Objective-C. Fixes an obscuer crash caused by multiple inclusion of
same framework after complaining about duplicate class definition.
// rdar://17024681

Modified:
    cfe/trunk/lib/Sema/SemaObjCProperty.cpp
    cfe/trunk/test/SemaObjC/arc-invalid.m

Modified: cfe/trunk/lib/Sema/SemaObjCProperty.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaObjCProperty.cpp?rev=209672&r1=209671&r2=209672&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaObjCProperty.cpp (original)
+++ cfe/trunk/lib/Sema/SemaObjCProperty.cpp Tue May 27 13:26:09 2014
@@ -1907,6 +1907,9 @@ void Sema::ProcessPropertyDecl(ObjCPrope
 
   ObjCMethodDecl *GetterMethod, *SetterMethod;
 
+  if (CD->isInvalidDecl())
+    return;
+
   GetterMethod = CD->getInstanceMethod(property->getGetterName());
   SetterMethod = CD->getInstanceMethod(property->getSetterName());
   DiagnosePropertyAccessorMismatch(property, GetterMethod,

Modified: cfe/trunk/test/SemaObjC/arc-invalid.m
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/arc-invalid.m?rev=209672&r1=209671&r2=209672&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/arc-invalid.m (original)
+++ cfe/trunk/test/SemaObjC/arc-invalid.m Tue May 27 13:26:09 2014
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -fobjc-arc -fblocks -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fobjc-arc -fblocks -Wno-objc-root-class 
-verify %s
 
 // rdar://problem/10982793
 // [p foo] in ARC creates a cleanup.
@@ -16,3 +16,29 @@ void test1(void) {
   __autoreleasing id p; // expected-note {{'p' declared here}}
   takeBlock(^{ (void) p; }); // expected-error {{cannot capture 
__autoreleasing variable in a block}}
 }
+
+// rdar://17024681
+@class WebFrame;
+@interface WebView  // expected-note {{previous definition is here}}
+- (WebFrame *)mainFrame;
+@end
+
+@interface WebView  // expected-error {{duplicate interface definition for 
class 'WebView'}}
+@property (nonatomic, readonly, strong) WebFrame *mainFrame;
+@end
+
+@interface UIWebDocumentView
+- (WebView *)webView;
+@end
+
+@interface UIWebBrowserView : UIWebDocumentView
+@end
+
+@interface StoreBanner @end
+
+@implementation StoreBanner
++ (void)readMetaTagContentForUIWebBrowserView:(UIWebBrowserView *)browserView
+{
+  [[browserView webView] mainFrame];
+}
+@end


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to