diff --git a/lld/COFF/Writer.cpp b/lld/COFF/Writer.cpp index c67fac59f92b..083839c2bab4 100644 --- a/lld/COFF/Writer.cpp +++ b/lld/COFF/Writer.cpp @@ -219,7 +219,7 @@ uint64_t Defined::getSecrel() { uint64_t Defined::getSectionIndex() { if (auto *D = dyn_cast(this)) return D->getChunk()->getOutputSection()->SectionIndex; - if (auto *D = dyn_cast(this)) + if (isa(this)) return DefinedAbsolute::OutputSectionIndex; fatal("SECTION relocation points to a non-regular symbol: " + toString(*this));