[Attributor] Fix UB behavior on uninitalized bool variables.

Found by ASAN.
This commit is contained in:
Haojian Wu 2021-06-18 11:48:33 +02:00
parent 1f9dcd2b73
commit 3f5d53a525
2 changed files with 3 additions and 3 deletions

View File

@ -2181,7 +2181,7 @@ void Attributor::identifyDefaultAbstractAttributes(Function &F) {
// Every argument might be simplified. We have to go through the Attributor
// interface though as outside AAs can register custom simplification
// callbacks.
bool UsedAssumedInformation;
bool UsedAssumedInformation = false;
getAssumedSimplified(ArgPos, /* AA */ nullptr, UsedAssumedInformation);
// Every argument might be dead.
@ -2257,7 +2257,7 @@ void Attributor::identifyDefaultAbstractAttributes(Function &F) {
// Call site argument might be simplified. We have to go through the
// Attributor interface though as outside AAs can register custom
// simplification callbacks.
bool UsedAssumedInformation;
bool UsedAssumedInformation = false;
getAssumedSimplified(CBArgPos, /* AA */ nullptr, UsedAssumedInformation);
// Every call site argument might be marked "noundef".

View File

@ -8245,7 +8245,7 @@ struct AACallEdgesFunction : public AACallEdges {
SetVector<Function *> CalledFunctions;
/// Does this function have a call to a function that we don't know about.
bool HasUnknownCallee;
bool HasUnknownCallee = false;
};
} // namespace