We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ac061da commit db2457cCopy full SHA for db2457c
1 file changed
lib/checkbufferoverrun.cpp
@@ -1088,8 +1088,12 @@ void CheckBufferOverrunImpl::objectIndex()
1088
for (const ValueFlow::Value& v:values) {
1089
if (v.lifetimeKind != ValueFlow::Value::LifetimeKind::Address && v.lifetimeKind != ValueFlow::Value::LifetimeKind::Object)
1090
continue;
1091
- const Token* varTok = nextAfterAstRightmostLeaf(v.tokvalue->astParent());
1092
- varTok = varTok ? varTok->previous() : nullptr;
+ const Token* varTok = v.tokvalue;
+ if (Token::simpleMatch(varTok->astParent(), ".")) {
1093
+ varTok = varTok->astParent();
1094
+ while (Token::simpleMatch(varTok, "."))
1095
+ varTok = varTok->astOperand2();
1096
+ }
1097
const Variable *var = varTok ? varTok->variable() : nullptr;
1098
if (!var)
1099
0 commit comments