Skip to content

Commit

Permalink
[CodeGen] Fix regression from D83655
Browse files Browse the repository at this point in the history
Arm EHABI has a null LSDASection as it does its own thing, so we should
continue to return null in that case rather than try and cast it.
  • Loading branch information
jrtc27 committed Nov 3, 2020
1 parent 7601a21 commit f77c8a4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
Expand Up @@ -837,7 +837,8 @@ MCSection *
TargetLoweringObjectFileELF::getSectionForLSDA(const Function &F,
const TargetMachine &TM) const {
// If neither COMDAT nor function sections, use the monolithic LSDA section.
if (!F.hasComdat() && !TM.getFunctionSections())
// Re-use this path if LSDASection is null as in the Arm EHABI.
if (!LSDASection || (!F.hasComdat() && !TM.getFunctionSections()))
return LSDASection;

const auto *LSDA = cast<MCSectionELF>(LSDASection);
Expand Down

0 comments on commit f77c8a4

Please sign in to comment.