diff options
author | Evan Cheng <evan.cheng@apple.com> | 2006-05-30 18:04:34 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2006-05-30 18:04:34 +0000 |
commit | 19564e3d83c9c3cdf908005c91bad13d26b5cedf (patch) | |
tree | a11b72d7103a615413795d5a724b0a41c3f66afe | |
parent | 85ede37ca90b5d1846f37631ed2e8b8f96000db8 (diff) | |
download | llvm-19564e3d83c9c3cdf908005c91bad13d26b5cedf.tar.gz llvm-19564e3d83c9c3cdf908005c91bad13d26b5cedf.tar.bz2 llvm-19564e3d83c9c3cdf908005c91bad13d26b5cedf.tar.xz |
When a priority_queue is empty, the behavior of top() operator is
non-deterministic. Returns NULL when it's empty!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28560 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp b/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp index c9aa18a342..ad8ed5aaf9 100644 --- a/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp +++ b/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp @@ -356,6 +356,7 @@ public: } SUnit *pop() { + if (empty()) return NULL; SUnit *V = Queue.top(); Queue.pop(); return V; |