From: Lauro Ramos Venancio Date: Tue, 22 Jan 2008 19:15:30 +0000 (+0000) Subject: Fix two bugs in bitfield codegen. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9e18d3ed84a95be2bc42f1ce65d3bab2ee8a1e27;p=clang Fix two bugs in bitfield codegen. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46255 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/CodeGen/CodeGenTypes.cpp b/CodeGen/CodeGenTypes.cpp index 583537db9b..4cced51e25 100644 --- a/CodeGen/CodeGenTypes.cpp +++ b/CodeGen/CodeGenTypes.cpp @@ -578,8 +578,8 @@ void RecordOrganizer::placeBitField(const FieldDecl *FD) { // This is : struct { char a; int CurrentField:10;}; // where 'CurrentField' shares first field with 'a'. addPaddingFields(Cursor + BitFieldSize); - CGT.addFieldInfo(FD, i); - CGT.addBitFieldInfo(FD, Cursor, BitFieldSize); + CGT.addFieldInfo(FD, i - 1); + CGT.addBitFieldInfo(FD, Cursor - O, BitFieldSize); Cursor += BitFieldSize; } else { // Place the bitfield in a new LLVM field.