Crash when encountering a single line comment starting with an asterisk
- Dominant language
- Objective-C
- Stars
- 179
- Forks
- 25
- PR merge metrics
- No merged PRs in 30d
Description
Having a comment like this in an Objective-C source file makes ROADAttributesCodeGenerator crash. The asterisk appears to trigger the bug. I've tested with version 1.3.6.
```
//*rect = CGRectZero;
```
Stacktrace:
```
2017-06-23 15:58:19.475 ROADAttributesCodeGenerator[89599:25827246] *** Terminating app due to uncaught exception 'NSRangeException', reason: '-[__NSCFString replaceCharactersInRange:withString:]: Range or index out of bounds'
*** First throw call stack:
(
0 CoreFoundation 0x00007fffaf5ab37b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x00007fffc439f48d objc_exception_throw + 48
2 CoreFoundation 0x00007fffaf629c3d +[NSException raise:format:] + 205
3 CoreFoundation 0x00007fffaf5db3a5 mutateError + 261
4 ROADAttributesCodeGenerator 0x000000010521ffd5 +[RFSourceCodePreprocessor removeMultiLineComments:] + 165
5 ROADAttributesCodeGenerator 0x000000010521f864 +[RFSourceCodePreprocessor removeComments:] + 84
6 ROADAttributesCodeGenerator 0x000000010521da82 +[RFSourceCodePreprocessor prepareCodeForParsingWithImports:useDefines:] + 258
7 ROADAttributesCodeGenerator 0x000000010521a329 +[RFHeaderSectionParser parseSourceCode:forFileName:intoClass:intoProtocol:skipImports:useDefines:] + 409
8 ROADAttributesCodeGenerator 0x000000010522b230 +[RFSourceFilesProcessor gatherClassInfoFromFile:intoClass:intoProtocol:skipImports:useDefines:] + 352
9 ROADAttributesCodeGenerator 0x000000010522ae18 +[RFSourceFilesProcessor gatherClassesInfoFromSourceCodePath:intoClass:intoProtocol:useDefines:excludePaths:] + 2120
10 ROADAttributesCodeGenerator 0x000000010522a424 +[RFSourceFilesProcessor generateAttributeFactoriesIntoPath:fromSourceCodePaths:useDefines:excludePaths:] + 580
11 ROADAttributesCodeGenerator 0x00000001052129db main + 363
12 libdyld.dylib 0x00007fffc4c84235 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.