Skip to content

Commit 2ae2f59

Browse files
committed
GVNHoist - silence static analyzer dyn_cast<> null dereference warning in hasEHOrLoadsOnPath call. NFCI.
The static analyzer is warning about a potential null dereference, but we should be able to use cast<> directly and if not assert will fire for us. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@375429 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent c4c5944 commit 2ae2f59

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/Transforms/Scalar/GVNHoist.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ class GVNHoist {
539539

540540
// Check for unsafe hoistings due to side effects.
541541
if (K == InsKind::Store) {
542-
if (hasEHOrLoadsOnPath(NewPt, dyn_cast<MemoryDef>(U), NBBsOnAllPaths))
542+
if (hasEHOrLoadsOnPath(NewPt, cast<MemoryDef>(U), NBBsOnAllPaths))
543543
return false;
544544
} else if (hasEHOnPath(NewBB, OldBB, NBBsOnAllPaths))
545545
return false;

0 commit comments

Comments
 (0)