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

Bug 560636 - Fix a small potential race

In commit f69a613d72, a check for null and
0-length array was introduced, but the checks is not reliable unless the
checked value is later used.

Change-Id: Ifc32b369514ee03eeea21281a7af80616531af87
Signed-off-by: Torbjörn Svensson <azoff@svenskalinuxforeningen.se>
This commit is contained in:
Torbjörn Svensson 2020-03-08 17:57:51 +01:00
parent b03db67d41
commit 65eee1c0b0

View file

@ -3781,7 +3781,7 @@ public class CPPSemantics {
setTargetedFunctionsToUnknown(tmp);
ICPPConstructor[] ctors = type.getConstructors();
if (ctors != null && ctors.length > 0) {
return CPPDeferredFunction.createForCandidates(type.getConstructors());
return CPPDeferredFunction.createForCandidates(ctors);
} else {
return new ProblemBinding(typeId, ISemanticProblem.BINDING_NOT_FOUND,
type.getNameCharArray());