Added another @synchronized() test that results in a segfault

main
qmathe 15 years ago
parent 10cb4f9b5c
commit c4cc8f4734

@ -29,6 +29,7 @@ static int stringsEqual(const char *a, const char *b)
- (int) manyTypes; - (int) manyTypes;
- (void) synchronizedCode; - (void) synchronizedCode;
+ (void) synchronizedCode; + (void) synchronizedCode;
+ (id) shared;
- (BOOL) basicThrowAndCatchException; - (BOOL) basicThrowAndCatchException;
@end @end
@ -62,6 +63,11 @@ static int stringsEqual(const char *a, const char *b)
{ {
@synchronized(self) { } @synchronized(self) { }
} }
+ (id) shared
{
@synchronized(self) { }
return nil;
}
- (void) throwException - (void) throwException
{ {
@throw [NSException exceptionWithName: @"RuntimeTestException" reason: @"" userInfo: nil]; @throw [NSException exceptionWithName: @"RuntimeTestException" reason: @"" userInfo: nil];
@ -214,6 +220,7 @@ void testSynchronized()
printf("Enter synchronized code\n"); printf("Enter synchronized code\n");
[foo synchronizedCode]; [foo synchronizedCode];
[foo release]; [foo release];
[Foo shared];
printf("testSynchronized() ran\n"); printf("testSynchronized() ran\n");
} }

Loading…
Cancel
Save