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]

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


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~


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