diff options
Diffstat (limited to 'libc/malloc_debug/PointerData.cpp')
-rw-r--r-- | libc/malloc_debug/PointerData.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libc/malloc_debug/PointerData.cpp b/libc/malloc_debug/PointerData.cpp index f811a5eb4..85139e607 100644 --- a/libc/malloc_debug/PointerData.cpp +++ b/libc/malloc_debug/PointerData.cpp @@ -392,10 +392,12 @@ void PointerData::GetList(std::vector<ListInfoType>* list, bool only_with_backtr FrameInfoType* b_frame = b.frame_info; if (a_frame == nullptr && b_frame != nullptr) { return false; - } - if (a_frame != nullptr && b_frame == nullptr) { + } else if (a_frame != nullptr && b_frame == nullptr) { return true; + } else if (a_frame == nullptr && b_frame == nullptr) { + return a.pointer < b.pointer; } + // Put the pointers with longest backtrace first. if (a_frame->frames.size() != b_frame->frames.size()) { return a_frame->frames.size() > b_frame->frames.size(); |