This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR objc/18255, sub protocals are not being initialized
- From: Ziemowit Laski <zlaski at apple dot com>
- To: Andrew Pinski <pinskia at physics dot uc dot edu>
- Cc: "gcc-patches at gcc dot gnu dot org Patches" <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 31 Oct 2004 15:52:04 -0800
- Subject: Re: [PATCH] Fix PR objc/18255, sub protocals are not being initialized
- References: <A0711F84-2B8E-11D9-A2F5-000A95D692F4@physics.uc.edu>
On 31 Oct 2004, at 14.45, Andrew Pinski wrote:
The problem is that sub protocals are not initializing so we get a
seg fault at runtime while trying to sending a message to the
protocal from the supper protocal. This problem only effects the
GNU runtime.
This patch adds the supper protocals to static instances and fixes
the bug.
OK? Bootstrapped and test on powerpc-darwin with -fgnu-runtime when
running the testsuite.
I'm looking at the code, and wondering why objc_build_protocol_expr()
has an 'if (!flag_next_runtime) { ... }' block at all! At the end
of compilation, the compiler calls generate_protocols(), which has
the following interesting fragment:
/* If a protocol was directly referenced, pull in indirect
references. */
for (p = protocol_chain; p; p = TREE_CHAIN (p))
if (PROTOCOL_FORWARD_DECL (p) && PROTOCOL_LIST (p))
generate_protocol_references (PROTOCOL_LIST (p));
where generate_protocol_references() looks eerily similar to your
add_protocal_to_static_instances(). :-)
What do you think? What happens if you comment out the GNU-specific
block in objc_build_protocol_expr() and let generate_protocols()
do its thing instead?
--Zem