Created
January 14, 2009 21:35
-
-
Save ddribin/47095 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* To recreate: | |
% gcc -o applescript-crash applescript-crash.m -framework Foundation | |
% DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib gdb ./applescript-crash | |
(gdb) run | |
*/ | |
#import <Foundation/Foundation.h> | |
int main (int argc, const char * argv[]) { | |
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; | |
NSString * source = @"tell application \"Finder\"\nend tell"; | |
NSAppleScript * script = [[[NSAppleScript alloc] initWithSource:source] autorelease]; | |
NSCAssert(script != nil, @"script should not be nil"); | |
NSDictionary * errorDict = nil; | |
[script compileAndReturnError:&errorDict]; | |
[pool drain]; | |
return 0; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment