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

_______________________________________________
Discuss-gnustep mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep

Reply via email to