1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-11 10:15:39 +02:00

Bug 501615 - NPE in EvalFunctionCall.computeForFunctionCall

Change-Id: I2ff67299b05b80fcc0451e1cc5b4532c88364f61
This commit is contained in:
Sergey Prigogin 2016-09-16 17:18:48 -07:00
parent 6b2530050f
commit ee1d72c7f8

View file

@ -18,8 +18,6 @@ import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUti
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.REF;
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.TDEF;
import java.util.Arrays;
import org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory;
import org.eclipse.cdt.core.dom.ast.IASTNode;
import org.eclipse.cdt.core.dom.ast.IBinding;
@ -48,6 +46,8 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.OverloadableOperator;
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPSemantics.LookupMode;
import org.eclipse.core.runtime.CoreException;
import java.util.Arrays;
public class EvalFunctionCall extends CPPDependentEvaluation {
private final ICPPEvaluation[] fArguments;
private ICPPFunction fOverload = CPPFunction.UNINITIALIZED_FUNCTION;
@ -221,10 +221,13 @@ public class EvalFunctionCall extends CPPDependentEvaluation {
return EvalFixed.INCOMPLETE;
}
ICPPFunction functionBinding = resolveFunctionBinding(context.getPoint());
if (functionBinding == null)
return EvalFixed.INCOMPLETE;
ICPPEvaluation[] args = new ICPPEvaluation[fArguments.length];
System.arraycopy(fArguments, 0, args, 0, fArguments.length);
ICPPFunction functionBinding = resolveFunctionBinding(context.getPoint());
ICPPParameter[] parameters = functionBinding.getParameters();
for (int i = 0; i < fArguments.length; i++) {
ICPPEvaluation arg = fArguments[i].computeForFunctionCall(record, context.recordStep());