]> granicus.if.org Git - clang/commitdiff
[NFC] Initialize a variable to prevent future invalid deref.
authorErich Keane <erich.keane@intel.com>
Fri, 3 Aug 2018 18:08:36 +0000 (18:08 +0000)
committerErich Keane <erich.keane@intel.com>
Fri, 3 Aug 2018 18:08:36 +0000 (18:08 +0000)
Found by KlockWorks, this variable is properly protected, however
the conditions in the test that initializes it and the one that uses
it could diverge, it seems to me that this is a 'free' init that will
prevent issues if one of the conditions is ever modified without the other.

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

lib/CodeGen/CGBlocks.cpp

index 8269b5b229a28041bd2209e264820f243c59d762..16436830b11606d332748c66960028c0ef7f70c1 100644 (file)
@@ -1076,7 +1076,7 @@ RValue CodeGenFunction::EmitBlockCallExpr(const CallExpr *E,
     E->getCallee()->getType()->getAs<BlockPointerType>();
 
   llvm::Value *BlockPtr = EmitScalarExpr(E->getCallee());
-  llvm::Value *FuncPtr;
+  llvm::Value *FuncPtr = nullptr;
 
   if (!CGM.getLangOpts().OpenCL) {
     // Get a pointer to the generic block literal.