Hey David-
I've now got a very pruned-down program that reproduces the bug. However, that
program still uses NSException, NSAutoreleasePool, and the
NS_DURING/HANDLER/ENDHANDLER macros. I've tried replacing these with plain
@try/@catch and @throw in order to depend only on libobjc2, but so far the
latter code hasn't reproduced the bug. For example, here is some code from my
minimal code that reproduces the bug:
@interface MinRep2 : NSObject {
}
- (void)poke;
@end
@implementation MinRep2
- (void)poke {
NSAutoreleasePool *pool = [NSAutoreleasePool new];
NS_DURING {
[NSException raise:@"foo" format:@"bar"];
} NS_HANDLER {
[localException retain];
[pool release];
[[localException autorelease] raise];
} NS_ENDHANDLER
[pool release];
}
@end
I tried to translate this into code that depends only on libobjc2 as follows
(this inherits the Test class in the libobjc2 Test directory):
@interface MinRep2 : Test {
}
- (void)poke;
@end
@implementation MinRep2
- (void)poke {
id e1;
@try {
@throw e1;
} @catch (id x) {
[x retain];
[x autorelease];
@throw x;
}
}
@end
Am I doing this translation approximately the right way? The "raise" method in
the gnustep-base NSException class does a lot of things, and so it's likely
that my call to @throw above might be missing something essential to coercing
the ObjC exceptions to and from a C++ one.
Thank you,
David
_______________________________________________
Discuss-gnustep mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep