aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Laskey <jlaskey@mac.com>2006-11-08 14:16:39 +0000
committerJim Laskey <jlaskey@mac.com>2006-11-08 14:16:39 +0000
commitb8244e4f6be4dd49817c95a433a5188a5e5c7fd9 (patch)
tree4e905f72cd53a8f94fb6d07d778a135ca9fc3e33
parentc63592b19ecd54a1318a19d87b5c0bd85f172a4f (diff)
Wasn't handling case of when machine move labels were undefined.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31548 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/CodeGen/MachineDebugInfo.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/llvm/CodeGen/MachineDebugInfo.h b/include/llvm/CodeGen/MachineDebugInfo.h
index 7b6386730b..46078d25ef 100644
--- a/include/llvm/CodeGen/MachineDebugInfo.h
+++ b/include/llvm/CodeGen/MachineDebugInfo.h
@@ -1046,13 +1046,18 @@ public:
/// RemapLabel - Indicate that a label has been merged into another.
///
void RemapLabel(unsigned OldLabelID, unsigned NewLabelID) {
+ assert(0 < OldLabelID && OldLabelID <= LabelIDList.size() &&
+ "Old debug label ID out of range.");
+ assert(NewLabelID <= LabelIDList.size() &&
+ "New debug label ID out of range.");
LabelIDList[OldLabelID - 1] = NewLabelID;
}
/// MappedLabel - Find out the label's final ID. Zero indicates deletion.
/// ID != Mapped ID indicates that the label was folded into another label.
unsigned MappedLabel(unsigned LabelID) const {
- return LabelIDList[LabelID - 1];
+ assert(LabelID <= LabelIDList.size() && "Debug label ID out of range.");
+ return LabelID ? LabelIDList[LabelID - 1] : 0;
}
/// RecordSource - Register a source file with debug info. Returns an source