This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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]

Increment


bfd_hash_lookup in bfd/hash.c has an incorrectly indented and
misplaced increment of table->count:

  if (copy)
    {
      char *new;
  table->count ++;

      new = objalloc_alloc ((struct objalloc *) table->memory, len + 1);
      if (!new)
	{
	  bfd_set_error (bfd_error_no_memory);
	  return NULL;
	}
      memcpy (new, string, len + 1);
      string = new;
    }

Shouldn't that be incremented regardless of whether COPY is true?

Bug or error?

Ian


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