summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2012-07-10 15:41:33 +0000
committerChandler Carruth <chandlerc@gmail.com>2012-07-10 15:41:33 +0000
commit77d940011d293aa904cb0426d412bc8f26d9ef1a (patch)
treeeefd4cd1e67ade3533525c2e6352f4c95b98ca7c /llvm/lib
parenta9c86c980bea6e51ce4cb09d0d629d05970a34ff (diff)
downloadbcm5719-llvm-77d940011d293aa904cb0426d412bc8f26d9ef1a.tar.gz
bcm5719-llvm-77d940011d293aa904cb0426d412bc8f26d9ef1a.zip
Fix a bug where I didn't test for an empty range before inspecting the
back of it. I don't have anything even remotely close to a test case for this. It only broke two build bots, both of them doing bootstrap builds, one of them a dragonegg bootstrap. It doesn't break for me when I bootstrap either. It doesn't reproduce every time or on many machines during the bootstrap. Many thanks to Duncan Sands who got the exact command (and stage of the bootstrap) which failed on the dragonegg bootstrap and managed to get it to trigger under valgrind with debug symbols. The fix was then found by inspection. llvm-svn: 159993
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/LiveInterval.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/LiveInterval.cpp b/llvm/lib/CodeGen/LiveInterval.cpp
index 2dfd714e9ec..9342439cc3d 100644
--- a/llvm/lib/CodeGen/LiveInterval.cpp
+++ b/llvm/lib/CodeGen/LiveInterval.cpp
@@ -579,7 +579,8 @@ void LiveInterval::mergeIntervalRanges(const LiveInterval &RHS,
// And finally insert any trailing end of RHS (if we have one).
for (; RI != RE; ++RI)
- if (ranges.back().valno == LHSValNo && RI->start <= ranges.back().end) {
+ if (!ranges.empty() &&
+ ranges.back().valno == LHSValNo && RI->start <= ranges.back().end) {
ranges.back().end = std::max(ranges.back().end, RI->end);
} else {
ranges.push_back(*RI);
OpenPOWER on IntegriCloud