Fixed CID 1192595: Dereference null return value in checkother.

This commit is contained in:
orbitcowboy 2014-05-23 18:11:44 +02:00
parent bc0682d1e9
commit 85496cfadc
1 changed files with 3 additions and 1 deletions

View File

@ -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;
}