[DebugInfo] Fix initialization of DwarfCompileUnit::LabelBegin.

This also fixes the condition in the assertion in
DwarfCompileUnit::getLabelBegin() because it checked something unrelated
to the returned value.

Differential Revision: https://reviews.llvm.org/D85437
This commit is contained in:
Igor Kudrin 2020-08-10 15:56:30 +07:00
parent 69eb7e36aa
commit d400606f8c
1 changed files with 2 additions and 2 deletions

View File

@ -57,7 +57,7 @@ class DwarfCompileUnit final : public DwarfUnit {
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 @@ public:
void addAddrTableBase();
MCSymbol *getLabelBegin() const {
assert(getSection());
assert(LabelBegin && "LabelBegin is not initialized");
return LabelBegin;
}