Fix uninitialized memory error introduced in d65c02f3
This commit is contained in:
11
expr.cpp
11
expr.cpp
@@ -6486,25 +6486,24 @@ FunctionSymbolExpr::tryResolve(int (*matchFunc)(const Type *, const Type *),
|
|||||||
// potential match versus detecting this earlier in the
|
// potential match versus detecting this earlier in the
|
||||||
// matching process and just giving up.
|
// matching process and just giving up.
|
||||||
const Type *paramType = ft->GetParameterType(i);
|
const Type *paramType = ft->GetParameterType(i);
|
||||||
|
|
||||||
if (callTypes[i] == NULL || paramType == NULL ||
|
if (callTypes[i] == NULL || paramType == NULL ||
|
||||||
dynamic_cast<const FunctionType *>(callTypes[i]) != NULL)
|
dynamic_cast<const FunctionType *>(callTypes[i]) != NULL)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
int argCost;
|
int argCost = matchFunc(callTypes[i], paramType);
|
||||||
if (argCost == -1 && argCouldBeNULL != NULL &&
|
if (argCost == -1) {
|
||||||
(*argCouldBeNULL)[i] == true &&
|
if (argCouldBeNULL != NULL && (*argCouldBeNULL)[i] == true &&
|
||||||
dynamic_cast<const PointerType *>(paramType) != NULL)
|
dynamic_cast<const PointerType *>(paramType) != NULL)
|
||||||
// If the passed argument value is zero and this is a
|
// If the passed argument value is zero and this is a
|
||||||
// pointer type, then it can convert to a NULL value of
|
// pointer type, then it can convert to a NULL value of
|
||||||
// that pointer type.
|
// that pointer type.
|
||||||
argCost = 0;
|
argCost = 0;
|
||||||
else
|
else
|
||||||
argCost= matchFunc(callTypes[i], paramType);
|
|
||||||
|
|
||||||
if (argCost == -1)
|
|
||||||
// If the predicate function returns -1, we have failed no
|
// If the predicate function returns -1, we have failed no
|
||||||
// matter what else happens, so we stop trying
|
// matter what else happens, so we stop trying
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
cost += argCost;
|
cost += argCost;
|
||||||
}
|
}
|
||||||
if (i == (int)callTypes.size()) {
|
if (i == (int)callTypes.size()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user