This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: [objc] Fix PR18862


Alexander Malmberg <alexander@malmberg.org> writes:

> This PR is about a crash when trying to use -Wselector with the GNU runtime.

...
>           warning ("%Jcreating selector for nonexistent method %qE",
>                    TREE_PURPOSE (chain), TREE_VALUE (chain));
>
> ... which uses the location of TREE_PURPOSE (chain) unconditionally,
> hence the crash. (When using the GNU runtime, TREE_PURPOSE (chain) is
> used for the 'type' of the selector, and it's NULL if the type is
> unknown, which I believe is always the case for the selectors we'll
> warn about here; not sure if there's a sensible location on the type
> in other cases.)

Good catch.  (Grumble mumble overloaded tree pointers grumble.)

> objc/ChangeLog:
> 2005-01-26  Alexander Malmberg  <alexander@malmberg.org>
>
> 	PR objc/18862
> 	* objc-act.c (build_selector_translation_table): Use
> 	input_location in the diagnostic for the GNU runtime or if
> 	TREE_PURPOSE (chain) is NULL.
>
> testsuite/ChangeLog:
> 2005-01-26  Alexander Malmberg  <alexander@malmberg.org>
>
> 	PR objc/18862
> 	* objc.dg/selector-2.m: New test.

This is OK.

zw


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