]> granicus.if.org Git - clang/commitdiff
Fixed bug where ivar offsets were being initialized as 0 with the fragile GNU ABI.
authorDavid Chisnall <csdavec@swan.ac.uk>
Tue, 17 Nov 2009 19:32:15 +0000 (19:32 +0000)
committerDavid Chisnall <csdavec@swan.ac.uk>
Tue, 17 Nov 2009 19:32:15 +0000 (19:32 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89133 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGObjCGNU.cpp

index a71cd839306bf246590ba0b0f1ac375e90558749..b431daa958f0b80a16972dae44515f837573b647 100644 (file)
@@ -1191,8 +1191,8 @@ void CGObjCGNU::GenerateClass(const ObjCImplementationDecl *OID) {
       Context.getObjCEncodingForType((*iter)->getType(), TypeStr);
       IvarTypes.push_back(MakeConstantString(TypeStr));
       // Get the offset
-      uint64_t Offset = 0;
       uint64_t BaseOffset = ComputeIvarBaseOffset(CGM, ClassDecl, *iter);
+      uint64_t Offset = BaseOffset;
       if (CGM.getContext().getLangOptions().ObjCNonFragileABI) {
         Offset = BaseOffset - superInstanceSize;
       }