Skip to content

Commit 57e8f0b

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. llvm-svn: 375429
1 parent 783d3c4 commit 57e8f0b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/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)