This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RFC: fix bug in compare_breakpoints


I built gdb with clang today.

This found a bunch of nits (I'll send a nit-cleanup patch later) but
also a couple real bugs.

Here's the first one.  compare_breakpoints has an invalid comparison.

Built (with clang and gcc) and regtested (gcc only) on x86-64 F16.

Tom

2012-10-17  Tom Tromey  <tromey@redhat.com>

	* breakpoint.c (compare_breakpoints): Fix comparison.

diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index bebad75..76e3e89 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -11766,7 +11766,7 @@ compare_breakpoints (const void *a, const void *b)
      the number 0.  */
   if (ua < ub)
     return -1;
-  return ub > ub ? 1 : 0;
+  return ua > ub ? 1 : 0;
 }
 
 /* Delete breakpoints by address or line.  */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]