forked from OSchip/llvm-project
[bugpoint] ReduceCrashingFunctions::TestFuncs - fix dereference of null point static analyzer warning
Alias.getAliaseeObject() shouldn't be null, do use dyn_cast instead of dyn_cast_or_null Also, remove redundant `else if (!F)` test - that is always true at the point in the if-else chain
This commit is contained in:
parent
d356cdcf31
commit
46f0e2ceb4
|
@ -270,7 +270,7 @@ bool ReduceCrashingFunctions::TestFuncs(std::vector<Function *> &Funcs) {
|
|||
// First, remove aliases to functions we're about to purge.
|
||||
for (GlobalAlias &Alias : M->aliases()) {
|
||||
GlobalObject *Root = Alias.getAliaseeObject();
|
||||
Function *F = dyn_cast_or_null<Function>(Root);
|
||||
auto *F = dyn_cast<Function>(Root);
|
||||
if (F) {
|
||||
if (Functions.count(F))
|
||||
// We're keeping this function.
|
||||
|
@ -278,7 +278,7 @@ bool ReduceCrashingFunctions::TestFuncs(std::vector<Function *> &Funcs) {
|
|||
} else if (Root->isNullValue()) {
|
||||
// This referenced a globalalias that we've already replaced,
|
||||
// so we still need to replace this alias.
|
||||
} else if (!F) {
|
||||
} else {
|
||||
// Not a function, therefore not something we mess with.
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue