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

Bug 564026 - Fix null pointer exception

The ICPPFunction array can contain null values. A check is needed.

Change-Id: Icde40880f7913d0de7ae2c0a293de8d5be899327
This commit is contained in:
Marco Stornelli 2020-06-13 08:33:09 +02:00
parent ef2ee6df71
commit 51398ca2ae

View file

@ -186,6 +186,9 @@ public final class CPPVariableReadWriteFlags extends VariableReadWriteFlags {
int argPos = ArrayUtil.indexOf(args, argument);
Optional<Integer> cumulative = Optional.empty();
for (ICPPFunction f : candidates) {
if (f == null) {
continue;
}
IType type = f.getType();
if (type instanceof IFunctionType) {
Optional<Integer> res = rwArgumentForFunctionCall((IFunctionType) type, argPos,