Forward container size values in subfunctions (#3483)

This commit is contained in:
Paul Fultz II 2021-10-05 01:22:19 -05:00 committed by GitHub
parent 61cddabe74
commit c7e13d0e0b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 2 deletions

View File

@ -6336,8 +6336,6 @@ static void valueFlowSubFunction(TokenList* tokenlist, SymbolDatabase* symboldat
return !v.isLocalLifetimeValue() && !v.isSubFunctionLifetimeValue(); return !v.isLocalLifetimeValue() && !v.isSubFunctionLifetimeValue();
return false; return false;
}); });
// Don't forward container sizes for now since programmemory can't evaluate conditions
argvalues.remove_if(std::mem_fn(&ValueFlow::Value::isContainerSizeValue));
// Remove uninit values if argument is passed by value // Remove uninit values if argument is passed by value
if (argtok->variable() && !argtok->variable()->isPointer() && argvalues.size() == 1 && argvalues.front().isUninitValue()) { if (argtok->variable() && !argtok->variable()->isPointer() && argvalues.size() == 1 && argvalues.front().isUninitValue()) {
if (CheckUninitVar::isVariableUsage(tokenlist->isCPP(), argtok, settings->library, false, CheckUninitVar::Alloc::NO_ALLOC, 0)) if (CheckUninitVar::isVariableUsage(tokenlist->isCPP(), argtok, settings->library, false, CheckUninitVar::Alloc::NO_ALLOC, 0))