1
0
Fork 0
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:
John Camelon 2005-02-01 16:49:20 +00:00
parent 7f65d614a3
commit 497e768f98

View file

@ -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 );
}