From: David Chisnall Date: Tue, 17 Nov 2009 19:32:15 +0000 (+0000) Subject: Fixed bug where ivar offsets were being initialized as 0 with the fragile GNU ABI. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=aecbf24a6bad049437f8fec97e557d414003a3db;p=clang Fixed bug where ivar offsets were being initialized as 0 with the fragile GNU ABI. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89133 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGObjCGNU.cpp b/lib/CodeGen/CGObjCGNU.cpp index a71cd83930..b431daa958 100644 --- a/lib/CodeGen/CGObjCGNU.cpp +++ b/lib/CodeGen/CGObjCGNU.cpp @@ -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; }