Bug 12309 - [objc-imp] ICE on @implementation after undefined protocol declaration
Summary: [objc-imp] ICE on @implementation after undefined protocol declaration
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: objc (show other bugs)
Version: unknown
: P2 normal
Target Milestone: 3.4.0
Assignee: Not yet assigned to anyone
URL:
Keywords: error-recovery, ice-on-invalid-code
Depends on:
Blocks:
 
Reported: 2003-09-17 00:53 UTC by David Ayers
Modified: 2005-07-23 22:49 UTC (History)
2 users (show)

See Also:
Host: *-*-*
Target: *-*-*
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
Fix + test case (1.03 KB, patch)
2003-09-19 22:25 UTC, Ziemowit Laski
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Ayers 2003-09-17 00:53:04 UTC
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
Comment 1 Ziemowit Laski 2003-09-19 22:25:52 UTC
Created attachment 4784 [details]
Fix + test case

I will commit this to objc-improvements-branch.
Comment 2 GCC Commits 2003-09-19 23:05:40 UTC
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

Comment 3 Andrew Pinski 2003-09-20 01:22:02 UTC
Fixed on the branch.
Comment 4 Ziemowit Laski 2003-09-25 01:42:58 UTC
Fix merged to mainline.