]> granicus.if.org Git - clang/commitdiff
Fix uninitialized use in GetAddrOfGlobalBlock, reenable assert.
authorDaniel Dunbar <daniel@zuster.org>
Thu, 12 Mar 2009 03:07:24 +0000 (03:07 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Thu, 12 Mar 2009 03:07:24 +0000 (03:07 +0000)
 - Mike, please verify.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66762 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGBlocks.cpp

index f10f0159e2ec5c2613805134cf507aaff558291a..53e52ad478a1282fb823bd97fab676f6077bacb1 100644 (file)
@@ -557,7 +557,7 @@ BlockModule::GetAddrOfGlobalBlock(const BlockExpr *BE, const char * n) {
   CodeGenFunction::BlockInfo Info(0, n);
   uint64_t subBlockSize, subBlockAlign;
   llvm::SmallVector<const Expr *, 8> subBlockDeclRefDecls;
-  bool subBlockHasCopyDispose;
+  bool subBlockHasCopyDispose = false;
   llvm::Function *Fn
     = CodeGenFunction(CGM).GenerateBlockFunction(BE, Info, subBlockSize,
                                                  subBlockAlign,
@@ -567,7 +567,7 @@ BlockModule::GetAddrOfGlobalBlock(const BlockExpr *BE, const char * n) {
          && "no imports allowed for global block");
   // FIXME: This causes a failure on clang-i686-linux, not sure why,
   // disable for now.
-  // assert(!subBlockHasCopyDispose && "no imports allowed for global block");
+  assert(!subBlockHasCopyDispose && "no imports allowed for global block");
 
   // isa
   LiteralFields[0] = getNSConcreteGlobalBlock();