diff options
author | Chris Lattner <sabre@nondot.org> | 2004-12-04 01:22:09 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-12-04 01:22:09 +0000 |
commit | 5684f4817f46969a6457694bb7bbd0af765824a0 (patch) | |
tree | 5814790fd0908da317e5c7cfba0c909dbfb6df69 /llvm/lib | |
parent | 68ef9a9a4d9c4280cd60f18c5ef55d641452947b (diff) | |
download | bcm5719-llvm-5684f4817f46969a6457694bb7bbd0af765824a0.tar.gz bcm5719-llvm-5684f4817f46969a6457694bb7bbd0af765824a0.zip |
Prevent accessing past the end of the intervals vector, this fixes
Prolang-C/bison in the JIT
llvm-svn: 18477
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/LiveInterval.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/LiveInterval.cpp b/llvm/lib/CodeGen/LiveInterval.cpp index 54e460f7b46..a8bc1615b41 100644 --- a/llvm/lib/CodeGen/LiveInterval.cpp +++ b/llvm/lib/CodeGen/LiveInterval.cpp @@ -74,7 +74,9 @@ bool LiveInterval::overlapsFrom(const LiveInterval& other, i = std::upper_bound(i, ie, j->start); if (i != ranges.begin()) --i; } else if (j->start < i->start) { - if ((++StartPos)->start <= i->start) { + ++StartPos; + if (StartPos != other.end() && StartPos->start <= i->start) { + assert(StartPos < other.end() && i < end()); j = std::upper_bound(j, je, i->start); if (j != other.ranges.begin()) --j; } |