1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-08 18:26:01 +02:00

Fix 2 NPEs

This commit is contained in:
Anton Leherbauer 2008-01-16 16:48:01 +00:00
parent 1c83f17a74
commit 9fb1c69789
2 changed files with 6 additions and 2 deletions

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2000, 2007 QNX Software Systems and others. * Copyright (c) 2000, 2008 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -101,6 +101,7 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
public TranslationUnit(ICElement parent, URI uri, String idType) { public TranslationUnit(ICElement parent, URI uri, String idType) {
super(parent, (IResource)null, uri.toString(), ICElement.C_UNIT); super(parent, (IResource)null, uri.toString(), ICElement.C_UNIT);
location= uri;
setContentTypeID(idType); setContentTypeID(idType);
} }

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2004, 2007 IBM Corporation and others. * Copyright (c) 2004, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -78,6 +78,9 @@ public class CPPImplicitMethod extends CPPImplicitFunction implements ICPPMethod
//first check if we already know it //first check if we already know it
if( declarations != null ){ if( declarations != null ){
for( int i = 0; i < declarations.length; i++ ){ for( int i = 0; i < declarations.length; i++ ){
if (declarations[i] == null) {
break;
}
IASTDeclaration decl = (IASTDeclaration) declarations[i].getParent(); IASTDeclaration decl = (IASTDeclaration) declarations[i].getParent();
if( decl.getParent() instanceof ICPPASTCompositeTypeSpecifier ) if( decl.getParent() instanceof ICPPASTCompositeTypeSpecifier )
return decl; return decl;