ExprEngine; Fix uninitialized value FP in subfunction when argument is passed by value

This commit is contained in:
Daniel Marjamäki 2020-06-19 18:05:56 +02:00
parent 6ec15b6d7b
commit 8653c4b3a9
1 changed files with 4 additions and 1 deletions

View File

@ -1578,8 +1578,11 @@ static ExprEngine::ValuePtr executeFunctionCall(const Token *tok, Data &data)
const Scope *functionScope = function->functionScope; const Scope *functionScope = function->functionScope;
int argnr = 0; int argnr = 0;
for (const Variable &arg: function->argumentList) { for (const Variable &arg: function->argumentList) {
if (argnr < argValues.size()) if (argnr < argValues.size()) {
if (!arg.isReference())
argValues[argnr] = translateUninitValueToRange(argValues[argnr], arg.valueType(), data);
data.assignValue(function->functionScope->bodyStart, arg.declarationId(), argValues[argnr]); data.assignValue(function->functionScope->bodyStart, arg.declarationId(), argValues[argnr]);
}
// TODO default values! // TODO default values!
argnr++; argnr++;
} }