r338909 - [NFC] Initialize a variable to prevent future invalid deref.
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Fri Aug 3 11:08:36 PDT 2018
Author: erichkeane
Date: Fri Aug 3 11:08:36 2018
New Revision: 338909
URL: http://llvm.org/viewvc/llvm-project?rev=338909&view=rev
Log:
[NFC] Initialize a variable to prevent future invalid deref.
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.
Modified:
cfe/trunk/lib/CodeGen/CGBlocks.cpp
Modified: cfe/trunk/lib/CodeGen/CGBlocks.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBlocks.cpp?rev=338909&r1=338908&r2=338909&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGBlocks.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGBlocks.cpp Fri Aug 3 11:08:36 2018
@@ -1076,7 +1076,7 @@ RValue CodeGenFunction::EmitBlockCallExp
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.
More information about the cfe-commits
mailing list