From 63ddbc2fbc31f2ef32f61d7c603d42bb92a7dcbd Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Fri, 20 Sep 2019 21:27:49 +0000 Subject: [PATCH] [PPC] PPCLoopPreIncPrep - silence static analyzer null dereference warning. llvm-svn: 372430 --- llvm/lib/Target/PowerPC/PPCLoopPreIncPrep.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/Target/PowerPC/PPCLoopPreIncPrep.cpp b/llvm/lib/Target/PowerPC/PPCLoopPreIncPrep.cpp index 4d45d96..a3c52a8 100644 --- a/llvm/lib/Target/PowerPC/PPCLoopPreIncPrep.cpp +++ b/llvm/lib/Target/PowerPC/PPCLoopPreIncPrep.cpp @@ -481,7 +481,7 @@ bool PPCLoopPreIncPrep::runOnLoop(Loop *L) { if (PtrIP && isa(NewBasePtr) && cast(NewBasePtr)->getParent() == PtrIP->getParent()) PtrIP = nullptr; - else if (isa(PtrIP)) + else if (PtrIP && isa(PtrIP)) PtrIP = &*PtrIP->getParent()->getFirstInsertionPt(); else if (!PtrIP) PtrIP = I->Instr; -- 2.7.4