[patch bfd]: Follow-up for dump of xdata SEH

Richard Henderson rth@redhat.com
Fri Oct 8 15:39:00 GMT 2010


On 10/08/2010 02:58 AM, Kai Tietz wrote:

I'd like to see a little more commentary here.  It took me a minute
or three to convince myself that all of this is ok.

/* Search for the current entry in the sorted array.  */

> +	      p = (bfd_vma *)
> +	          bsearch (&rf.rva_UnwindData, xdata_arr,
> +			   (size_t) xdata_arr_cnt, sizeof (bfd_vma),
> +			   sort_xdata_arr);

Null check impossible?  We're searching for an entry that we
know we added.

> +	      if (p != NULL)
> +	        {

/* Advance to the next pointer into the xdata section.  We may
   have shared xdata entries, which will result in a string of
   identical pointers in the array; advance past all of them.  */

> +		  while (p[0] <= rf.rva_UnwindData)
> +		    ++p;
> +		  if (p[0] == ~((bfd_vma) 0))
> +		    p = NULL;
> +		}

Otherwise ok.


r~



More information about the Binutils mailing list