This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug objc/22606] New: Exceptions cannot be thrown from -forward::
- From: "creep at desk dot pl" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Jul 2005 08:28:07 -0000
- Subject: [Bug objc/22606] New: Exceptions cannot be thrown from -forward::
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
When @throw'ing form -forward:: method, the unwinding will stop at -forward
method with code == _URC_END_OF_STACK in gcc/unwind.inc:_Unwind_RaiseException
This code aborts while throwing. (compiled with -fobjc-exceptions of course)
-----------------------------------------------------------
#import <objc/Object.h>
#import <objc/objc-api.h>
@interface Thrower : Object
- forward: (SEL) s : (arglist_t) a;
@end
@implementation Thrower
- forward: (SEL) s : (arglist_t) a
{
printf("Forwarding %s\n", sel_get_name(s));
@throw [Object new];
}
@end
int
main()
{
id t = [Thrower new];
@try
{
[t doesnotexist];
}
@catch (id error)
{
printf("Got error class %s\n", [[error class] name]);
[error free];
}
}
-----------------------------------------------------
--
Summary: Exceptions cannot be thrown from -forward::
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: objc
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: creep at desk dot pl
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22606