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: [PATCH] Fix PR objc/18255, sub protocals are not being initialized



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


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