diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h --- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h @@ -57,7 +57,7 @@ DwarfCompileUnit *Skeleton = nullptr; /// The start of the unit within its section. - MCSymbol *LabelBegin; + MCSymbol *LabelBegin = nullptr; /// The start of the unit macro info within macro section. MCSymbol *MacroLabelBegin; @@ -299,7 +299,7 @@ void addAddrTableBase(); MCSymbol *getLabelBegin() const { - assert(getSection()); + assert(LabelBegin && "LabelBegin is not initialized"); return LabelBegin; }