Closed GoogleCodeExporter closed 8 years ago
Heres a patch for this NPE.
Index:
src/org/eclipse/cdt/objc/core/internal/dom/parser/objc/GNUObjCSourceParser.java
===================================================================
---
src/org/eclipse/cdt/objc/core/internal/dom/parser/objc/GNUObjCSourceParser.java
(revision 84)
+++
src/org/eclipse/cdt/objc/core/internal/dom/parser/objc/GNUObjCSourceParser.java
(working copy)
@@ -1821,8 +1821,13 @@
declarationList(decl, opts, false, stopImage, codeBranchNesting);
final IToken la1 = LAcatchEOF(1);
- if (stopImage == null || la1.getImage().equals(stopImage)) {
- int endOffset = la1.getEndOffset();
+ if (stopImage == null || /* la1 == null for EOF */la1 == null ||
la1.getImage().equals(stopImage)) {
+ int endOffset = offset;
+ if (la1 != null) {
+ endOffset = la1.getEndOffset();
+ } else {
+ endOffset = ((ASTNode) decl).getOffset() + ((ASTNode)
decl).getLength();
+ }
setRange(decl, offset, endOffset);
return;
}
Original comment by rrusaw@gmail.com
on 8 Jul 2009 at 1:54
Thanks, will apply/test/commit later today
Original comment by alex.ble...@gmail.com
on 8 Jul 2009 at 8:18
Committed the fix after testing
Original comment by alex.ble...@gmail.com
on 8 Jul 2009 at 11:17
Original comment by alex.ble...@gmail.com
on 9 Jul 2009 at 9:50
Original comment by alex.ble...@gmail.com
on 10 Jul 2009 at 2:40
Original issue reported on code.google.com by
alex.ble...@gmail.com
on 8 Jul 2009 at 12:18