diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp index 62c4d0b5a366..b9d118488b86 100644 --- a/lld/ELF/Writer.cpp +++ b/lld/ELF/Writer.cpp @@ -1429,7 +1429,7 @@ template void Writer::sortSections() { sortInputSections(); for (SectionCommand *cmd : script->sectionCommands) - if (auto *osec = dyn_cast_or_null(cmd)) + if (auto *osec = dyn_cast(cmd)) osec->sortRank = getSectionRank(osec); if (!script->hasSectionsCommand) { // We know that all the OutputSections are contiguous in this case.