Skip to content

Commit 445c986

Browse files
authored
removed unused inconclusive handling from isAliasOf() (#6932)
1 parent 4903a41 commit 445c986

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

lib/astutils.cpp

+3-10
Original file line numberDiff line numberDiff line change
@@ -1056,9 +1056,8 @@ bool isAliasOf(const Token *tok, nonneg int varid, bool* inconclusive)
10561056
return false;
10571057
}
10581058

1059-
bool isAliasOf(const Token* tok, const Token* expr, int* indirect, bool* inconclusive)
1059+
bool isAliasOf(const Token* tok, const Token* expr, int* indirect)
10601060
{
1061-
const ValueFlow::Value* value = nullptr;
10621061
const Token* r = nullptr;
10631062
if (indirect)
10641063
*indirect = 1;
@@ -1080,11 +1079,7 @@ bool isAliasOf(const Token* tok, const Token* expr, int* indirect, bool* inconcl
10801079
[&](const Token* aliasTok) {
10811080
return aliasTok != childTok && aliasTok->exprId() == childTok->exprId();
10821081
})) {
1083-
if (val.isInconclusive() && inconclusive != nullptr) {
1084-
value = &val;
1085-
} else {
1086-
return true;
1087-
}
1082+
return true;
10881083
}
10891084
}
10901085
}
@@ -1093,9 +1088,7 @@ bool isAliasOf(const Token* tok, const Token* expr, int* indirect, bool* inconcl
10931088
if (r)
10941089
break;
10951090
}
1096-
if (!r && value && inconclusive)
1097-
*inconclusive = true;
1098-
return r || value;
1091+
return r;
10991092
}
11001093

11011094
static bool isAliased(const Token *startTok, const Token *endTok, nonneg int varid)

lib/astutils.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ bool isExpressionChangedAt(const Token* expr,
373373
/// If token is an alias if another variable
374374
bool isAliasOf(const Token *tok, nonneg int varid, bool* inconclusive = nullptr);
375375

376-
bool isAliasOf(const Token* tok, const Token* expr, int* indirect = nullptr, bool* inconclusive = nullptr);
376+
bool isAliasOf(const Token* tok, const Token* expr, int* indirect = nullptr);
377377

378378
const Token* getArgumentStart(const Token* ftok);
379379

0 commit comments

Comments
 (0)