[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
This commit is contained in:
Simon Pilgrim 2022-02-02 15:35:46 +00:00
parent aedea002b4
commit 9031e5113c
1 changed files with 1 additions and 1 deletions

View File

@ -875,7 +875,7 @@ Error ResourceFileWriter::visitIconOrCursorResource(const RCResource *Base) {
FileStr = IconRes->IconLoc;
Type = IconCursorGroupType::Icon;
} else {
auto *CursorRes = dyn_cast<CursorResource>(Base);
auto *CursorRes = cast<CursorResource>(Base);
FileStr = CursorRes->CursorLoc;
Type = IconCursorGroupType::Cursor;
}