summaryrefslogtreecommitdiff
path: root/runtime/class_linker.cc
diff options
context:
space:
mode:
author Richard Uhler <ruhler@google.com> 2015-07-17 15:22:10 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2015-07-17 15:22:11 +0000
commit511bb656522e22f0570a9edff8dd295e0de6c145 (patch)
treebe5d83d766c5f3b61669a1ce6d8d7eb5f997ed9d /runtime/class_linker.cc
parent2661ffc6f739f2006bfa5c70bbb2f60badfaf321 (diff)
parentfab6788358dfb64e5c370611ddbbbffab0ed0553 (diff)
Merge "Fix FieldGap priority queue ordering bug."
Diffstat (limited to 'runtime/class_linker.cc')
-rw-r--r--runtime/class_linker.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index 122c35fdc3..5798c04ba8 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -195,7 +195,9 @@ struct FieldGapsComparator {
bool operator() (const FieldGap& lhs, const FieldGap& rhs)
NO_THREAD_SAFETY_ANALYSIS {
// Sort by gap size, largest first. Secondary sort by starting offset.
- return lhs.size > rhs.size || (lhs.size == rhs.size && lhs.start_offset < rhs.start_offset);
+ // Note that the priority queue returns the largest element, so operator()
+ // should return true if lhs is less than rhs.
+ return lhs.size < rhs.size || (lhs.size == rhs.size && lhs.start_offset > rhs.start_offset);
}
};
typedef std::priority_queue<FieldGap, std::vector<FieldGap>, FieldGapsComparator> FieldGaps;