]> granicus.if.org Git - clang/commitdiff
Fixed a bug exposed by fixing the assert in previous patch (one of the tests asserted).
authorFariborz Jahanian <fjahanian@apple.com>
Wed, 31 Oct 2007 23:08:24 +0000 (23:08 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Wed, 31 Oct 2007 23:08:24 +0000 (23:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43586 91177308-0d34-0410-b5e6-96231b3b80d8

Driver/RewriteTest.cpp

index 4e01dedcb55a68946a876c4232341ad91e029c21..257a060ba981d1b50ee6eecd96b3f9d388bb1c7f 100644 (file)
@@ -544,6 +544,9 @@ void RewriteTest::SynthesizeObjcInternalStruct(ObjcInterfaceDecl *CDecl,
                                                std::string &Result) {
   assert(CDecl && "Class missing in SynthesizeObjcInternalStruct");
   assert(CDecl->getName() && "Name missing in SynthesizeObjcInternalStruct");
+  // Do not synthesize more than once.
+  if (ObjcSynthesizedStructs.count(CDecl))
+    return;
   ObjcInterfaceDecl *RCDecl = CDecl->getSuperClass();
   if (RCDecl && !ObjcSynthesizedStructs.count(RCDecl)) {
     // Do it for the root