Bug 444034 - jprof fails to sort symbols correctly. r=dbaron
authorJoshua Cranmer <Pidgeot18@gmail.com>
Tue, 23 Sep 2008 21:15:52 -0400
changeset 19612 3bfd66c81a78530ad7c3d80a688665f6940f6fb7
parent 19611 eaab26598282c5f838c06a36c234276ec8348d39
child 19613 6ee837a12440463802a617521b5ff42a4b8bac66
push idunknown
push userunknown
push dateunknown
reviewersdbaron
bugs444034
milestone1.9.1b1pre
Bug 444034 - jprof fails to sort symbols correctly. r=dbaron
tools/jprof/leaky.cpp
--- a/tools/jprof/leaky.cpp
+++ b/tools/jprof/leaky.cpp
@@ -286,18 +286,18 @@ void leaky::open()
 
 //----------------------------------------------------------------------
 
 
 static int symbolOrder(void const* a, void const* b)
 {
   Symbol const* ap = (Symbol const *)a;
   Symbol const* bp = (Symbol const *)b;
-  ptrdiff_t diff = ap->address - bp->address;
-  return (diff == 0) ? 0 : ((diff > 0) ? 1 : -1);
+  return ap->address == bp->address ? 0 :
+    (ap->address > bp->address ? 1 : -1);
 }
 
 void leaky::ReadSharedLibrarySymbols()
 {
   LoadMapEntry* lme = loadMap;
   while (NULL != lme) {
     ReadSymbols(lme->name, lme->address);
     lme = lme->next;