summaryrefslogtreecommitdiff
path: root/lib/CodeGen/LiveIntervalUnion.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2010-12-17 23:16:38 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2010-12-17 23:16:38 +0000
commit8d121404370cd57be7e72543127a1afe2faa1b10 (patch)
treef1031385bc2a5e61ab4ed51df2ad8c2d5bb3283d /lib/CodeGen/LiveIntervalUnion.cpp
parentaf24964251e27c2dd863239ba66ffd967b593be5 (diff)
downloadllvm-8d121404370cd57be7e72543127a1afe2faa1b10.tar.gz
llvm-8d121404370cd57be7e72543127a1afe2faa1b10.tar.bz2
llvm-8d121404370cd57be7e72543127a1afe2faa1b10.tar.xz
Avoid dereferencing end() in collectInterferingVRegs() when there is no
interference. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122108 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LiveIntervalUnion.cpp')
-rw-r--r--lib/CodeGen/LiveIntervalUnion.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/CodeGen/LiveIntervalUnion.cpp b/lib/CodeGen/LiveIntervalUnion.cpp
index 7ebe96f066..cec68850fa 100644
--- a/lib/CodeGen/LiveIntervalUnion.cpp
+++ b/lib/CodeGen/LiveIntervalUnion.cpp
@@ -238,7 +238,7 @@ collectInterferingVRegs(unsigned MaxInterferingRegs) {
InterferenceResult IR = firstInterference();
LiveInterval::iterator VirtRegEnd = VirtReg->end();
LiveInterval *RecentInterferingVReg = NULL;
- while (IR.LiveUnionI.valid()) {
+ if (IR.VirtRegI != VirtRegEnd) while (IR.LiveUnionI.valid()) {
// Advance the union's iterator to reach an unseen interfering vreg.
do {
if (IR.LiveUnionI.value() == RecentInterferingVReg)