mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-07 08:15:48 +02:00
Partial fix for Bug 84146 - there are dirty ASTNodes floating around with "null declarators"
This commit is contained in:
parent
7f65d614a3
commit
497e768f98
1 changed files with 2 additions and 0 deletions
|
@ -19,6 +19,7 @@ public abstract class ASTNode implements IASTNode {
|
|||
|
||||
private int length;
|
||||
private int offset;
|
||||
private static final IASTNodeLocation[] EMPTY_LOCATION_ARRAY = new IASTNodeLocation[0];
|
||||
|
||||
public int getOffset() {
|
||||
return offset;
|
||||
|
@ -52,6 +53,7 @@ public abstract class ASTNode implements IASTNode {
|
|||
* @see org.eclipse.cdt.core.dom.ast.IASTNode#getNodeLocations()
|
||||
*/
|
||||
public IASTNodeLocation[] getNodeLocations() {
|
||||
if( length == 0 ) return EMPTY_LOCATION_ARRAY;
|
||||
return getTranslationUnit().getLocationInfo( offset, length );
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue