]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
There were two functions who were calling "sizeof" twice.
authorSergio Durigan Junior <sergiodj@redhat.com>
Wed, 16 Oct 2013 02:55:27 +0000 (02:55 +0000)
committerSergio Durigan Junior <sergiodj@redhat.com>
Wed, 16 Oct 2013 02:55:27 +0000 (02:55 +0000)
The first one, dw2_get_real_path from gdb/dwarf2read.c, was actually
making use of OBSTACK_CALLOC which already calls "sizeof" for its third
argument.

The second, download_tracepoint_1 from gdb/gdbserver/tracepoint.c, was
explicitly calling "sizeof" inside another "sizeof".

This patch fixed both functions.

gdb/ChangeLog
2013-10-16  Sergio Durigan Junior  <sergiodj@redhat.com>

PR gdb/16014
* dwarf2read.c (dw2_get_real_path): Remove unnecessary call to
sizeof.

gdb/gdbserver/ChangeLog
2013-10-16  Sergio Durigan Junior  <sergiodj@redhat.com>

PR gdb/16014
* tracepoint.c (download_tracepoint_1): Remove unnecessary double
call to sizeof.

gdb/ChangeLog
gdb/dwarf2read.c
gdb/gdbserver/ChangeLog
gdb/gdbserver/tracepoint.c

index b2f1fc8dfacb120f6ac93a0344f9f7cdada78304..ab19f6201c970eae2f2e258bb907b6b2e32146da 100644 (file)
@@ -1,3 +1,9 @@
+2013-10-16  Sergio Durigan Junior  <sergiodj@redhat.com>
+
+       PR gdb/16014
+       * dwarf2read.c (dw2_get_real_path): Remove unnecessary call to
+       sizeof.
+
 2013-10-16  Sergio Durigan Junior  <sergiodj@redhat.com>
 
        PR gdb/16042
index aa109e0080b1e028330b0764b350664220c6b83f..3974d0b2f8af7ec9bc97b9f3ed24cf6744bf5fd7 100644 (file)
@@ -3278,7 +3278,7 @@ dw2_get_real_path (struct objfile *objfile,
 {
   if (qfn->real_names == NULL)
     qfn->real_names = OBSTACK_CALLOC (&objfile->objfile_obstack,
-                                     qfn->num_file_names, sizeof (char *));
+                                     qfn->num_file_names, char *);
 
   if (qfn->real_names[index] == NULL)
     qfn->real_names[index] = gdb_realpath (qfn->file_names[index]);
index 3138f478682e0920b80f8f4f1c284117f792b93e..4f15cfb2cf64e59bf9154fc8f88665dc853701e2 100644 (file)
@@ -1,3 +1,9 @@
+2013-10-16  Sergio Durigan Junior  <sergiodj@redhat.com>
+
+       PR gdb/16014
+       * tracepoint.c (download_tracepoint_1): Remove unnecessary double
+       call to sizeof.
+
 2013-10-02  Pedro Alves  <palves@redhat.com>
 
        * server.c (process_serial_event): Don't output "GDBserver
index 3288a139c034734c9e5143f455ac4b272fe903de..ea1a8a106fa2efd41d127e3a99fd9004e560eeeb 100644 (file)
@@ -6023,7 +6023,7 @@ download_tracepoint_1 (struct tracepoint *tpoint)
 
          if (ipa_action != 0)
            write_inferior_data_ptr
-             (actions_array + i * sizeof (sizeof (*tpoint->actions)),
+             (actions_array + i * sizeof (*tpoint->actions),
               ipa_action);
        }
     }