diff options
author | Erich Keane <erich.keane@intel.com> | 2018-08-03 18:08:36 +0000 |
---|---|---|
committer | Erich Keane <erich.keane@intel.com> | 2018-08-03 18:08:36 +0000 |
commit | ed69e1bc98c7bd3c9e4ad285915ff6422d68a8ba (patch) | |
tree | 11caea44f373483c124b292d1554c79b277046c7 /clang/lib/CodeGen | |
parent | 0a11b6366a926c731794facfd697371e829fcdc1 (diff) | |
download | bcm5719-llvm-ed69e1bc98c7bd3c9e4ad285915ff6422d68a8ba.tar.gz bcm5719-llvm-ed69e1bc98c7bd3c9e4ad285915ff6422d68a8ba.zip |
[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.
llvm-svn: 338909
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r-- | clang/lib/CodeGen/CGBlocks.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGBlocks.cpp b/clang/lib/CodeGen/CGBlocks.cpp index 8269b5b229a..16436830b11 100644 --- a/clang/lib/CodeGen/CGBlocks.cpp +++ b/clang/lib/CodeGen/CGBlocks.cpp @@ -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. |