mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
fix NPE bug 97447
This commit is contained in:
parent
e5e342776d
commit
b7745b5167
2 changed files with 14 additions and 0 deletions
|
@ -651,4 +651,17 @@ public class AST2KnRTests extends AST2BaseTest {
|
|||
assertEquals( lemp_name3.resolveBinding(), lemp_name4.resolveBinding() );
|
||||
}
|
||||
|
||||
public void testBug97447() throws Exception {
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
buffer.append("void f( a ) int a; {} \n");
|
||||
buffer.append("void f( int ); \n");
|
||||
|
||||
IASTTranslationUnit tu = parse(buffer.toString(), ParserLanguage.C, true);
|
||||
CNameCollector col = new CNameCollector();
|
||||
tu.accept(col);
|
||||
|
||||
IFunction def = (IFunction) col.getName(0).resolveBinding();
|
||||
IFunction f1 = (IFunction) col.getName(3).resolveBinding();
|
||||
IParameter a = (IParameter) col.getName(4).resolveBinding();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -232,6 +232,7 @@ public class CFunction implements IFunction, ICInternalBinding {
|
|||
temp = ((IASTStandardFunctionDeclarator)definition).getParameters()[idx];
|
||||
temp.getDeclarator().getName().setBinding( binding );
|
||||
} else if( definition instanceof ICASTKnRFunctionDeclarator ){
|
||||
fKnRDtor = (ICASTKnRFunctionDeclarator) definition;
|
||||
IASTName n = fKnRDtor.getParameterNames()[idx];
|
||||
n.setBinding( binding );
|
||||
IASTDeclarator dtor = CVisitor.getKnRParameterDeclarator( fKnRDtor, n );
|
||||
|
|
Loading…
Add table
Reference in a new issue