From c4cc8f4734d89babb6c9abc2024d68a5b3209000 Mon Sep 17 00:00:00 2001 From: qmathe Date: Mon, 4 Oct 2010 19:34:36 +0000 Subject: [PATCH] Added another @synchronized() test that results in a segfault --- Test/RuntimeTest.m | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Test/RuntimeTest.m b/Test/RuntimeTest.m index 88ac5d0..d798e15 100644 --- a/Test/RuntimeTest.m +++ b/Test/RuntimeTest.m @@ -29,6 +29,7 @@ static int stringsEqual(const char *a, const char *b) - (int) manyTypes; - (void) synchronizedCode; + (void) synchronizedCode; ++ (id) shared; - (BOOL) basicThrowAndCatchException; @end @@ -62,6 +63,11 @@ static int stringsEqual(const char *a, const char *b) { @synchronized(self) { } } ++ (id) shared +{ + @synchronized(self) { } + return nil; +} - (void) throwException { @throw [NSException exceptionWithName: @"RuntimeTestException" reason: @"" userInfo: nil]; @@ -214,6 +220,7 @@ void testSynchronized() printf("Enter synchronized code\n"); [foo synchronizedCode]; [foo release]; + [Foo shared]; printf("testSynchronized() ran\n"); }