Fixed CID 1192595: Dereference null return value in checkother.
This commit is contained in:
parent
bc0682d1e9
commit
85496cfadc
|
@ -3169,11 +3169,13 @@ static bool constructorTakesReference(const Scope * const classScope)
|
|||
if (func->isConstructor()) {
|
||||
const Function &constructor = *func;
|
||||
for (std::size_t argnr = 0U; argnr < constructor.argCount(); argnr++) {
|
||||
if (constructor.getArgumentVar(argnr)->isReference())
|
||||
const Variable * const argVar = constructor.getArgumentVar(argnr);
|
||||
if (argVar && argVar->isReference()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue