From 4c2bf4793555c9c709c43f21a3eb965219020126 Mon Sep 17 00:00:00 2001 From: Erich Keane Date: Fri, 3 Aug 2018 18:08:36 +0000 Subject: [PATCH] [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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@338909 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGBlocks.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/CodeGen/CGBlocks.cpp b/lib/CodeGen/CGBlocks.cpp index 8269b5b229..16436830b1 100644 --- a/lib/CodeGen/CGBlocks.cpp +++ b/lib/CodeGen/CGBlocks.cpp @@ -1076,7 +1076,7 @@ RValue CodeGenFunction::EmitBlockCallExpr(const CallExpr *E, E->getCallee()->getType()->getAs(); 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. -- 2.40.0