HomePhabricator

Fix undefined behavior in DWARF emission

Authored by linzj on Jul 13 2020, 6:28 PM.

Description

Fix undefined behavior in DWARF emission

Caused by uninitialized load of llvm::DwarfDebug::PrevCU:
llvm::DwarfCompileUnit::addRange () at ../lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:276
llvm::DwarfDebug::endFunctionImpl () at ../lib/CodeGen/AsmPrinter/DwarfDebug.cpp:1586
llvm::DebugHandlerBase::endFunction () at ../lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp:319
llvm::AsmPrinter::EmitFunctionBody () at ../lib/CodeGen/AsmPrinter/AsmPrinter.cpp:1230
llvm::ARMAsmPrinter::runOnMachineFunction () at ../lib/Target/ARM/ARMAsmPrinter.cpp:161

Most of the DebugInfo tests under LLVM_LIT_ARGS:STRING=-sv --vg prior to this fix, and pass with the fix applied.

Reviewed By: aprantl, dblaikie

Differential Revision: https://reviews.llvm.org/D81631

Details

Committed
dblaikieJul 13 2020, 6:32 PM
Reviewer
aprantl
Differential Revision
D81631: Fix undefined behavior in Dwarf.
Parents
rG9a9ae01f994a: [lldb-vscode] Fix TestVSCode_setBreakpoints
Branches
Unknown
Tags
Unknown