When compiling the @implementation of a class that declares to implement a protocol which hasn't been defined, an ICE occurs dur to the lack of the error_mark handling. Example code: --------------------------- #include <objc/objc.h> @interface MyClass <UndefinedProtocol> @end @implementation MyClass +(Class)class { return self; } @end ---------------------------- => QuickTest.m:3: error: cannot find protocol declaration for `UndefinedProtocol' QuickTest.m: In function `+[MyClass class]': QuickTest.m:8: internal compiler error: tree check: expected tree_list, have error_mark in lookup_method_in_protocol_list, at objc/objc-act.c:587
Created attachment 4784 [details] Fix + test case I will commit this to objc-improvements-branch.
Subject: Bug 12309 CVSROOT: /cvs/gcc Module name: gcc Branch: objc-improvements-branch Changes by: zlaski@gcc.gnu.org 2003-09-19 23:05:36 Modified files: gcc : ChangeLog gcc/testsuite : ChangeLog gcc/objc : objc-act.c Added files: gcc/testsuite/objc.dg: method-12.m missing-proto-3.m Log message: [gcc] 2003-09-19 Ziemowit Laski <zlaski@apple.com> PR objc/12309 * objc/objc-act.c (lookup_and_install_protocols): Exclude missing protocols from list instead of returning error_mark_node. [gcc/testsuite] 2003-09-19 Ziemowit Laski <zlaski@apple.com> PR objc/12262 * objc.dg/method-12.m: New test. PR objc/12309 * objc.dg/missing-proto-3.m: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=objc-improvements-branch&r1=2.424.2.4&r2=2.424.2.5 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=objc-improvements-branch&r1=1.2857.2.4&r2=1.2857.2.5 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/objc/objc-act.c.diff?cvsroot=gcc&only_with_tag=objc-improvements-branch&r1=1.179.2.13&r2=1.179.2.14 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/objc.dg/method-12.m.diff?cvsroot=gcc&only_with_tag=objc-improvements-branch&r1=NONE&r2=1.1.2.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/objc.dg/missing-proto-3.m.diff?cvsroot=gcc&only_with_tag=objc-improvements-branch&r1=NONE&r2=1.1.2.1
Fixed on the branch.
Fix merged to mainline.