mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-19 04:32:19 +00:00
Fix null dereference with -debug-only=dwarfdebug
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210299 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
d605148d07
commit
3b889b9d31
@ -1220,6 +1220,11 @@ DwarfDebug::collectVariableInfo(SmallPtrSet<const MDNode *, 16> &Processed) {
|
|||||||
if (Begin->getNumOperands() > 1 && Begin->getOperand(0).isReg() &&
|
if (Begin->getNumOperands() > 1 && Begin->getOperand(0).isReg() &&
|
||||||
!Begin->getOperand(0).getReg())
|
!Begin->getOperand(0).getReg())
|
||||||
continue;
|
continue;
|
||||||
|
DEBUG(dbgs() << "DotDebugLoc Pair:\n" << "\t" << *Begin);
|
||||||
|
if (End != nullptr)
|
||||||
|
DEBUG(dbgs() << "\t" << *End);
|
||||||
|
else
|
||||||
|
DEBUG(dbgs() << "\tNULL\n");
|
||||||
|
|
||||||
const MCSymbol *StartLabel = getLabelBeforeInsn(Begin);
|
const MCSymbol *StartLabel = getLabelBeforeInsn(Begin);
|
||||||
assert(StartLabel && "Forgot label before DBG_VALUE starting a range!");
|
assert(StartLabel && "Forgot label before DBG_VALUE starting a range!");
|
||||||
@ -1233,8 +1238,6 @@ DwarfDebug::collectVariableInfo(SmallPtrSet<const MDNode *, 16> &Processed) {
|
|||||||
EndLabel = getLabelBeforeInsn(std::next(I)->first);
|
EndLabel = getLabelBeforeInsn(std::next(I)->first);
|
||||||
assert(EndLabel && "Forgot label after instruction ending a range!");
|
assert(EndLabel && "Forgot label after instruction ending a range!");
|
||||||
|
|
||||||
DEBUG(dbgs() << "DotDebugLoc Pair:\n"
|
|
||||||
<< "\t" << *Begin << "\t" << *End << "\n");
|
|
||||||
DebugLocEntry Loc(StartLabel, EndLabel, getDebugLocValue(Begin), TheCU);
|
DebugLocEntry Loc(StartLabel, EndLabel, getDebugLocValue(Begin), TheCU);
|
||||||
if (DebugLoc.empty() || !DebugLoc.back().Merge(Loc))
|
if (DebugLoc.empty() || !DebugLoc.back().Merge(Loc))
|
||||||
DebugLoc.push_back(std::move(Loc));
|
DebugLoc.push_back(std::move(Loc));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user