summaryrefslogtreecommitdiff
path: root/lib/CodeGen/LiveInterval.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2012-09-27 21:05:59 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2012-09-27 21:05:59 +0000
commit657720bc6ed1f214c4e7f45f80dcc15b2e168288 (patch)
tree0326a848b92d8eb23a28eeae3f6ec63004a439ab /lib/CodeGen/LiveInterval.cpp
parentcb39aa05afd52f017869ce5399652223626da7b7 (diff)
downloadllvm-657720bc6ed1f214c4e7f45f80dcc15b2e168288.tar.gz
llvm-657720bc6ed1f214c4e7f45f80dcc15b2e168288.tar.bz2
llvm-657720bc6ed1f214c4e7f45f80dcc15b2e168288.tar.xz
Don't dereference begin() on an empty vector.
The fix is obvious and the only test case I have is horrible, so I am not including it. The problem shows up when self-hosting clang on i386 with -new-coalescer enabled. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164793 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LiveInterval.cpp')
-rw-r--r--lib/CodeGen/LiveInterval.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/CodeGen/LiveInterval.cpp b/lib/CodeGen/LiveInterval.cpp
index f4ebcd6fa4..c3bf2d234c 100644
--- a/lib/CodeGen/LiveInterval.cpp
+++ b/lib/CodeGen/LiveInterval.cpp
@@ -427,7 +427,7 @@ void LiveInterval::join(LiveInterval &Other,
// If we have to apply a mapping to our base interval assignment, rewrite it
// now.
- if (MustMapCurValNos) {
+ if (MustMapCurValNos && !empty()) {
// Map the first live range.
iterator OutIt = begin();