Skip to content

Commit 9031e51

Browse files
committed
[llvm-rc] Use cast<> instead of dyn_cast<> to avoid dereference of nullptr
The pointer is dereferenced immediately, so assert the cast is correct instead of returning nullptr
1 parent aedea00 commit 9031e51

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/tools/llvm-rc/ResourceFileWriter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,7 @@ Error ResourceFileWriter::visitIconOrCursorResource(const RCResource *Base) {
875875
FileStr = IconRes->IconLoc;
876876
Type = IconCursorGroupType::Icon;
877877
} else {
878-
auto *CursorRes = dyn_cast<CursorResource>(Base);
878+
auto *CursorRes = cast<CursorResource>(Base);
879879
FileStr = CursorRes->CursorLoc;
880880
Type = IconCursorGroupType::Cursor;
881881
}

0 commit comments

Comments
 (0)