PR symtab/20652 - fix psymbol_compare
authorTom Tromey <tom@tromey.com>
Fri, 30 Sep 2016 21:42:28 +0000 (15:42 -0600)
committerTom Tromey <tom@tromey.com>
Wed, 5 Oct 2016 16:31:34 +0000 (10:31 -0600)
This fixes an oversight in psymbol_compare.

2016-10-05  Tom Tromey  <tom@tromey.com>

PR symtab/20652:
* psymtab.c (psymbol_compare): Correctly compare "ginfo.value"
fields.

gdb/ChangeLog
gdb/psymtab.c

index e2b5c2b420712be8388b0a8467cf739c76d33bdb..1fc318ef7b442f52a11686af704e0cd4783ba9f9 100644 (file)
@@ -1,3 +1,9 @@
+2016-10-05  Tom Tromey  <tom@tromey.com>
+
+       PR symtab/20652:
+       * psymtab.c (psymbol_compare): Correctly compare "ginfo.value"
+       fields.
+
 2016-10-05  Andreas Arnez  <arnez@linux.vnet.ibm.com>
 
        * dwarf2expr.c (dwarf_expr_require_composition): Allow
index a39c6e257a2ad186f385ab5533dc90e67c6c9703..edcaa8bd9c24eaaa58d773e5076125f7ca663eb5 100644 (file)
@@ -1577,7 +1577,7 @@ psymbol_compare (const void *addr1, const void *addr2, int length)
   struct partial_symbol *sym1 = (struct partial_symbol *) addr1;
   struct partial_symbol *sym2 = (struct partial_symbol *) addr2;
 
-  return (memcmp (&sym1->ginfo.value, &sym1->ginfo.value,
+  return (memcmp (&sym1->ginfo.value, &sym2->ginfo.value,
                   sizeof (sym1->ginfo.value)) == 0
          && sym1->ginfo.language == sym2->ginfo.language
           && PSYMBOL_DOMAIN (sym1) == PSYMBOL_DOMAIN (sym2)