two patches for bugs in BFD/peXXigen.c
Andreas Schwab
schwab@linux-m68k.org
Mon Sep 6 17:46:00 GMT 2010
Kai Tietz <ktietz70@googlemail.com> writes:
> 2010/9/6 Alan Modra <amodra@gmail.com>:
>> @@ -1860,12 +1855,14 @@ _bfd_XX_print_ce_compressed_pdata (bfd *
>> Â Â Â if (tsection && coff_section_data (abfd, tsection)
>> Â Â Â Â Â && pei_section_data (abfd, tsection))
>> Â Â Â Â {
>> - Â Â Â Â if (bfd_malloc_and_get_section (abfd, tsection, & tdata))
>> - Â Â Â Â Â {
>> Â Â Â Â Â Â Â int xx = (begin_addr - 8) - tsection->vma;
>> + Â Â Â Â bfd_byte *tdata;
>>
>> Â Â Â Â Â Â Â tdata = (bfd_byte *) bfd_malloc (8);
>> - Â Â Â Â Â Â if (bfd_get_section_contents (abfd, tsection, tdata, (bfd_vma) xx, 8))
>> + Â Â Â Â if (tdata)
>> + Â Â Â Â Â {
>> + Â Â Â Â Â Â if (bfd_get_section_contents (abfd, tsection,
>> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â tdata, (bfd_vma) xx, 8))
>> Â Â Â Â Â Â Â Â {
>> Â Â Â Â Â Â Â Â Â bfd_vma eh, eh_data;
>>
>
> Here I don't see the reason for using 'int' as type for xx. Why not
> simply using here bfd_vma type and so no cast to this type is
> necessary?
And for extra bonus, rename the variable to something more
descriptive. :-)
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
More information about the Binutils
mailing list