mirror of
https://github.com/darlinghq/class-dump.git
synced 2025-02-11 23:07:22 +00:00
Raise and catch an exception if this isn't a Mach-O file, so at least
we don't seg fault.
This commit is contained in:
parent
513467af76
commit
c1622113e3
@ -8,7 +8,7 @@
|
||||
#include <regex.h>
|
||||
#import "CDStructureRegistrationProtocol.h"
|
||||
|
||||
#define CLASS_DUMP_VERSION @"3.0"
|
||||
#define CLASS_DUMP_VERSION @"3.1 (dev)"
|
||||
|
||||
@class NSMutableArray, NSMutableDictionary, NSMutableSet, NSMutableString, NSString;
|
||||
@class CDDylibCommand, CDMachOFile;
|
||||
|
@ -341,7 +341,15 @@ static NSMutableSet *wrapperExtensions = nil;
|
||||
|
||||
aMachOFile = [[CDMachOFile alloc] initWithFilename:aFilename];
|
||||
[aMachOFile setDelegate:self];
|
||||
[aMachOFile process];
|
||||
|
||||
// TODO (2005-07-03): Look for the newer exception handling stuff.
|
||||
NS_DURING {
|
||||
[aMachOFile process];
|
||||
} NS_HANDLER {
|
||||
NSLog(@"Caught exception in %s", _cmd);
|
||||
[aMachOFile release];
|
||||
return;
|
||||
} NS_ENDHANDLER;
|
||||
|
||||
aProcessor = [[CDObjCSegmentProcessor alloc] initWithMachOFile:aMachOFile];
|
||||
[aProcessor process];
|
||||
|
@ -65,6 +65,7 @@
|
||||
NSLog(@"Not a Mach-O file.");
|
||||
|
||||
// TODO (2003-12-14): Perhaps raise an exception or something.
|
||||
[NSException raise:NSGenericException format:@"Not a Mach-O file..."];
|
||||
}
|
||||
|
||||
loadCommands = [[self _processLoadCommands] retain];
|
||||
|
Loading…
x
Reference in New Issue
Block a user