This is the mail archive of the binutils@sources.redhat.com 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]

Re: [patch] BFD ieee.c fix


On 17 Oct 2000, Chris G. Demetriou wrote:

> The patch looks trivially correct (or at least "better than what was
> there" -- it's hard to describe that function's memory handling as
> "correct" 8-), and i've compiled the file, but made no attempt to test
> it.

I recommend this patch _not_ be applied, nor any future patch mentioning
the word trivial associated with bfd_release!

The reason that changes involving bfd_release are non-trivial is that 
bfd_release frees not only it's arg, but all memory more recently
bfd_alloc'd to the bfd as well.  That means you need to rummage through
all called functions (and any functions they call) between the point
of allocation and the release, checking each function for calls to
bfd_alloc.  If any do so, then you need to convince yourself that there is
no possibility of leaving dangling pointers.

This is not to say that your patch is wrong.  It may in fact be
correct.  It's just that I don't think you have done the checking I
mention above, especially since a quick check shows at least one of the
called functions does a bfd_alloc (but in the case I found leaves no
dangling pointer)

Regards, Alan Modra
-- 
Linuxcare.  Support for the Revolution.


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