Skip to content

Instantly share code, notes, and snippets.

@ddribin
Created January 14, 2009 21:35
Show Gist options
  • Save ddribin/47095 to your computer and use it in GitHub Desktop.
Save ddribin/47095 to your computer and use it in GitHub Desktop.
/*
* 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