Skip to content

Commit 36cf2df

Browse files
Update vf_analyzers.cpp
1 parent a156364 commit 36cf2df

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/vf_analyzers.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -892,7 +892,7 @@ static bool isAliasOf(const Variable * var, const Token *tok, nonneg int varid,
892892
return false;
893893
if (val.isLifetimeValue() && !val.isLocalLifetimeValue())
894894
return false;
895-
if (val.isLifetimeValue() && val.lifetimeKind != ValueFlow::Value::LifetimeKind::Address)
895+
if (val.isLifetimeValue() && val.lifetimeKind != ValueFlow::Value::LifetimeKind::Address && val.lifetimeKind != ValueFlow::Value::LifetimeKind::SubObject)
896896
return false;
897897
if (!Token::Match(val.tokvalue, ".|&|*|%var%"))
898898
return false;
@@ -1167,7 +1167,7 @@ struct SingleValueFlowAnalyzer : ValueFlowAnalyzer {
11671167
}
11681168

11691169
bool isAlias(const Token* tok, bool& inconclusive) const override {
1170-
if (value.isLifetimeValue())
1170+
if (value.isLifetimeValue() && value.lifetimeKind != ValueFlow::Value::LifetimeKind::SubObject)
11711171
return false;
11721172
for (const auto& m: {
11731173
std::ref(getVars()), std::ref(getAliasedVars())

0 commit comments

Comments
 (0)