summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2006-05-30 18:04:34 +0000
committerEvan Cheng <evan.cheng@apple.com>2006-05-30 18:04:34 +0000
commit61e9f0d6809ae939f14539b02b73860db0df4ab7 (patch)
tree43123b576c5b6c8f240f4317d3bd191958cb9480 /llvm/lib/CodeGen/SelectionDAG
parent5bc60da1123dc75b71697f6c667091db53c4130a (diff)
downloadbcm5719-llvm-61e9f0d6809ae939f14539b02b73860db0df4ab7.tar.gz
bcm5719-llvm-61e9f0d6809ae939f14539b02b73860db0df4ab7.zip
When a priority_queue is empty, the behavior of top() operator is
non-deterministic. Returns NULL when it's empty! llvm-svn: 28560
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp
index c9aa18a342e..ad8ed5aaf97 100644
--- a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp
@@ -356,6 +356,7 @@ public:
}
SUnit *pop() {
+ if (empty()) return NULL;
SUnit *V = Queue.top();
Queue.pop();
return V;
OpenPOWER on IntegriCloud