This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB 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: [RFA] objc-lang.c (selectors_info): Check strchr for null result.


> 2011-03-04  Michael Snyder  <msnyder@msnyder-server.eng.vmware.com>
> 
> 	* objc-lang.c (selectors_info): Check strchr for null result.

Another one where I'm not a specialist of the code, but I think
I get the intent of the code.

>  	  /* Find selector part.  */
>  	  name = (char *) strchr(name+2, ' ');
> +	  if (name == NULL)
> +	    internal_error (__FILE__, __LINE__, 
> +			    _("Bad method name '%s'"), 
> +			    SYMBOL_NATURAL_NAME (msymbol));

I think that the right thing to do, in this case, is to emit
a complaint.  The most probable way to trigger this problem
is by reading some invalid debugging information, and an
internal-error in this case would be mis-leading.  And we can
also recover nicely from it by simply ignoring the symbol.

-- 
Joel


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