Skip to content

Commit 6f16d44

Browse files
igorkudrinmemfrob
authored andcommitted
[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
1 parent 7c1594c commit 6f16d44

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class DwarfCompileUnit final : public DwarfUnit {
5757
DwarfCompileUnit *Skeleton = nullptr;
5858

5959
/// The start of the unit within its section.
60-
MCSymbol *LabelBegin;
60+
MCSymbol *LabelBegin = nullptr;
6161

6262
/// The start of the unit macro info within macro section.
6363
MCSymbol *MacroLabelBegin;
@@ -299,7 +299,7 @@ class DwarfCompileUnit final : public DwarfUnit {
299299
void addAddrTableBase();
300300

301301
MCSymbol *getLabelBegin() const {
302-
assert(getSection());
302+
assert(LabelBegin && "LabelBegin is not initialized");
303303
return LabelBegin;
304304
}
305305

0 commit comments

Comments
 (0)