1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 22:52:11 +02:00

Protect against an NPE.

This commit is contained in:
Sergey Prigogin 2015-06-03 18:18:57 -07:00
parent 4cf72bb41b
commit 4890e6e7e6
2 changed files with 8 additions and 2 deletions

View file

@ -80,6 +80,10 @@ public class CPPFunctionSet implements ICPPTwoPhaseBinding {
return null;
}
/**
* Returns the template arguments, or {@code null} if the function set doesn't represent a template
* specialization.
*/
public ICPPTemplateArgument[] getTemplateArguments() {
return fTemplateArguments;
}

View file

@ -332,8 +332,10 @@ public class EvalFunctionSet extends CPPDependentEvaluation {
int r = CPPTemplates.PACK_SIZE_NOT_FOUND;
if (fFunctionSet != null) {
ICPPTemplateArgument[] templateArguments = fFunctionSet.getTemplateArguments();
for (ICPPTemplateArgument arg : templateArguments) {
r = CPPTemplates.combinePackSize(r, CPPTemplates.determinePackSize(arg, tpMap));
if (templateArguments != null) {
for (ICPPTemplateArgument arg : templateArguments) {
r = CPPTemplates.combinePackSize(r, CPPTemplates.determinePackSize(arg, tpMap));
}
}
}
return r;