Fixed CID 1192595: Dereference null return value in checkother.
This commit is contained in:
parent
bc0682d1e9
commit
85496cfadc
|
@ -3169,8 +3169,10 @@ 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue