[patch] coff-i386, guard against null

msnyder@sonic.net msnyder@sonic.net
Fri Jul 27 01:42:00 GMT 2007


> On Thu, Jul 26, 2007 at 04:24:22PM -0700, msnyder@sonic.net wrote:
>> > On Thu, Jul 26, 2007 at 11:52:07AM -0700, msnyder@sonic.net wrote:
>> >> > On Thu, Jul 26, 2007 at 07:41:39AM -0400, Daniel Jacobowitz wrote:
>> >> >> On Wed, Jul 25, 2007 at 07:18:55PM -0700, H.J. Lu wrote:
>> >> >> > On Wed, Jul 25, 2007 at 05:21:13PM -0700, msnyder@sonic.net
>> wrote:
>> >> >> > > Other code in this function checks to see if sym is null.
>> >> >> > > If it's null here, it'll fail.
>> >> >> > >
>> >> >> >
>> >> >> > > 2007-07-25  Michael Snyder  <msnyder@access-company.com>
>> >> >> > >
>> >> >> > > 	* coff-i386.c (coff_i386_rtype_to_howto): Guard against null.
>> >> >> > >
>> >> >> >
>> >> >> > I prefer BFD_ASSERT (sym != NULL).
>> >> >>
>> >> >> BFD_ASSERT returns, though.
>> >> >
>> >> > I'd like to know when this condition happens. Crash is better than
>> >> > silent return.  That is how BFD_ASSERT is used other places.
>> >>
>> >> But it doesn't fix the problem that I set out to fix.
>> >> If it returns, we'll still crash.
>> >>
>> >> H.J., the change I submitted is consistant with existing code
>> >> in this module.  There are six local uses of "if (x != NULL)",
>> >> and only one local use of BFD_ASSERT.  I don't mind if you want
>> >> to add a BFD_ASSERT in addition, but why not let my change go in?
>> >
>> > OK with BFD_ASSERT.
>>
>> Sorry, I don't understand your reply.
>
> Your change is OK if you also add a BFD_ASSERT so that we will
> know something is wrong.

OK, committed.
Thanks.




More information about the Binutils mailing list