From afb47aa104be1d1af761e12d78612d1104ebfa6a Mon Sep 17 00:00:00 2001 From: Nathan Ridge Date: Thu, 23 Jun 2016 16:15:52 -0400 Subject: [PATCH] Bug 496657 - Fix an ArrayOutOfBoundsException during indexing Change-Id: Iee0617407bf59016dae26b2483dfc9d68ff84451 --- .../internal/core/dom/parser/cpp/semantics/EvalUnary.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalUnary.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalUnary.java index 1fdbc79bf35..2ff6835f794 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalUnary.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/EvalUnary.java @@ -282,7 +282,10 @@ public class EvalUnary extends CPPDependentEvaluation { ICPPFunction overload = getOverload(point); if (overload != null) { ICPPFunctionType functionType = overload.getType(); - IType targetType = functionType.getParameterTypes()[0]; + IType[] parameterTypes = functionType.getParameterTypes(); + if (parameterTypes.length == 0) + return Value.ERROR; + IType targetType = parameterTypes[0]; arg = maybeApplyConversion(arg, targetType, point); if (!(overload instanceof CPPImplicitFunction)) {