|
From: | Mathias Bauer |
Subject: | setValue:forKey broken for bool properties |
Date: | Sun, 19 Jan 2014 20:48:11 +0100 |
User-agent: | Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 |
Hi,the following simple program crashes because GSObjCSetVal in GSObjCRuntime.m does not handle boolean values:
#import <Foundation/Foundation.h> @interface TestObject : NSObject @property (nonatomic, assign) bool switcher; @end @implementation TestObject @end int main(int argc, const char * argv[]) { TestObject* test = [TestObject new]; [test setValue:[NSNumber numberWithBool:YES] forKey:@"switcher"]; return 0; }
compiled with:clang `gnustep-config --objc-flags` -x objective-c -fobjc-arc -std=gnu99 -fpascal-strings -fstrict-aliasing -lobjc -lgnustep-base `gnustep-config --objc-libs` test.m
I think this is a serious defect. On my system the type that needed to be handled in GSObjCSetVal would be "B16", but on other system this might be different.
I'm unsure about how a correct fix should be, so any opinions of people in the know would be greatly appreciated.
Best regards, Mathias
[Prev in Thread] | Current Thread | [Next in Thread] |