]> granicus.if.org Git - clang/commitdiff
Fix use of uninitialized variable in r338299
authorScott Linder <scott@scottlinder.com>
Mon, 30 Jul 2018 22:52:07 +0000 (22:52 +0000)
committerScott Linder <scott@scottlinder.com>
Mon, 30 Jul 2018 22:52:07 +0000 (22:52 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@338321 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGDebugInfo.cpp

index 8dca6f1ef7112df2eea4a59a88b9d14a833c1be6..5be6fb3e4245b1c2439a949d09cc70c86bee94f0 100644 (file)
@@ -989,9 +989,9 @@ llvm::DIType *CGDebugInfo::CreateType(const BlockPointerType *Ty,
     EltTys.push_back(DBuilder.createMemberType(
         Unit, "__descriptor", nullptr, LineNo, FieldSize, FieldAlign, FieldOffset,
         llvm::DINode::FlagZero, DescTy));
+    FieldOffset += FieldSize;
   }
 
-  FieldOffset += FieldSize;
   Elements = DBuilder.getOrCreateArray(EltTys);
 
   // The __block_literal_generic structs are marked with a special