diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp index 48ad826926f9..d7da4a238175 100644 --- a/lld/ELF/LinkerScript.cpp +++ b/lld/ELF/LinkerScript.cpp @@ -428,8 +428,7 @@ void LinkerScript::addOrphanSections(OutputSectionFactory &Factory) { }); if (I == End) { Factory.addInputSec(S, Name); - OutputSection *Sec = S->getOutputSection(); - assert(Sec->SectionIndex == INT_MAX); + assert(S->getOutputSection()->SectionIndex == INT_MAX); } else { OutputSection *Sec = cast(*I); Factory.addInputSec(S, Name, Sec);