summaryrefslogtreecommitdiffstats
path: root/llvm/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
commit4976d0df41ee263bcfc429615eacd348eb1b07d2 (patch)
tree0bc05f4845bf3c62eacdc89818ada77b2b33786c /llvm/lib/CodeGen/LiveInterval.cpp
parent2885a7088d0a66c2446e34e731560af9277d689d (diff)
downloadbcm5719-llvm-4976d0df41ee263bcfc429615eacd348eb1b07d2.tar.gz
bcm5719-llvm-4976d0df41ee263bcfc429615eacd348eb1b07d2.zip
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. llvm-svn: 164793
Diffstat (limited to 'llvm/lib/CodeGen/LiveInterval.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveInterval.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/LiveInterval.cpp b/llvm/lib/CodeGen/LiveInterval.cpp
index f4ebcd6fa45..c3bf2d234c0 100644
--- a/llvm/lib/CodeGen/LiveInterval.cpp
+++ b/llvm/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();
OpenPOWER on IntegriCloud