Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

NSArray out of bounds exception in GBCommentsProcessor #328

Closed
michaelochs opened this Issue · 1 comment

2 participants

@michaelochs

With the current master I am experiencing a problem running appledoc.

Call to build the docs:
appledoc --project-name XXX --project-company XXX --company-id com.XXX.YYY --project-version 1.1.2 --no-repeat-first-par --output Documentation/ Products/XXX.framework/Headers/

Output from appledoc:
WARN | Invalid [[NSAutoreleasePool alloc] reference found near xxx.h@13, unknown object : [NSAutoreleasePool !
WARN | Invalid [pool release] reference found near xxx.h@13, unknown object : pool !
WARN | Invalid [AppDelegate class] reference found near xxx.h@13, unknown object : AppDelegate !
WARN | Unknown cross reference xxx found at xxx.h@140!
WARN | Unknown cross reference xxx found at xxx.h@146!
WARN | Unknown cross reference xxx found at xxx+Deprecated.h@40!
WARN | Unknown cross reference xxx found at xxx+Deprecated.h@48!
Oops, something went wrong...
NSRangeException: *** -[__NSArrayI objectAtIndex:]: index 3 beyond bounds [0 .. 2]
@ 0 CoreFoundation 0x00007fff93e7e0a6 __exceptionPreprocess + 198
@ 1 libobjc.A.dylib 0x00007fff917ff3f0 objc_exception_throw + 43
@ 2 CoreFoundation 0x00007fff93e310f3 -[__NSArrayI objectAtIndex:] + 163
@ 3 appledoc 0x00000001021a2793 -[GBCommentsProcessor processAvailabilityBlockInString:lines:blockRange:shortRange:] + 243
@ 4 appledoc 0x00000001021a05fd -[GBCommentsProcessor processCommentBlockInLines:blockRange:shortRange:] + 1069
@ 5 appledoc 0x000000010219fd0b -[GBCommentsProcessor processComment:withContext:store:] + 1931
@ 6 appledoc 0x000000010219f55e -[GBCommentsProcessor processCommentForObject:withContext:store:] + 334
@ 7 appledoc 0x00000001021ac604 -[GBProcessor processCommentForObject:] + 372
@ 8 appledoc 0x00000001021ac20c -[GBProcessor processMethodsFromProvider:] + 620
@ 9 appledoc 0x00000001021aad76 -[GBProcessor processClasses] + 646
@ 10 appledoc 0x00000001021aaaac -[GBProcessor processObjectsFromStore:] + 492
@ 11 appledoc 0x0000000102162349 -[GBAppledocApplication application:runWithArguments:] + 1961
@ 12 appledoc 0x000000010215fc15 -[DDCliApplication runWithClass:] + 357
@ 13 appledoc 0x000000010215ff67 DDCliAppRunWithClass + 103
@ 14 appledoc 0x000000010215ed78 main + 56
@ 15 appledoc 0x000000010215ed34 start + 52
@ 16 ??? 0x000000000000000d 0x0 + 13

Notes:

  • The warnings are ok and can be ignored, these warnings have always been there
  • Sorry for all the xxx, we are under NDA for this project...

Possible solution:
I haven't worked with the appledoc sourcecode by now, but in the relevant method I found this:
// Get data from captures. Index 1 is directive, index 2 description text.
NSString *description = [components count] > 2 ? [components objectAtIndex:3] : @"";

To me this looks like an error, as the variable description should be equals the index 2 of the array, according to the comment. So I changed this to:
// Get data from captures. Index 1 is directive, index 2 description text.
NSString *description = [components count] > 2 ? [components objectAtIndex:2] : @"";

This fixes the crash and the resulting output looks good. However I didn't make a pull request as I am really not sure if this is even close to a good attempt to fix this issue.

@tomaz
Owner

Closing this one, will handle it with #349.

@michaelochs Comment on that one to be notified of progress...

@tomaz tomaz closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.