parent
350a1f2dfc
commit
b4c90f8b2a
|
@ -1620,7 +1620,7 @@ void CheckUninitVar::valueFlowUninit()
|
||||||
continue;
|
continue;
|
||||||
uninitderef = deref && v->indirect == 0;
|
uninitderef = deref && v->indirect == 0;
|
||||||
const bool isleaf = isLeafDot(tok) || uninitderef;
|
const bool isleaf = isLeafDot(tok) || uninitderef;
|
||||||
if (Token::Match(tok->astParent(), ". %var%") && !isleaf)
|
if (!isleaf && Token::Match(tok->astParent(), ". %name%") && (tok->astParent()->next()->varId() || tok->astParent()->next()->isEnumerator()))
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
const ExprUsage usage = getExprUsage(tok, v->indirect, mSettings);
|
const ExprUsage usage = getExprUsage(tok, v->indirect, mSettings);
|
||||||
|
|
|
@ -6272,6 +6272,16 @@ private:
|
||||||
" h.e();\n"
|
" h.e();\n"
|
||||||
"}\n");
|
"}\n");
|
||||||
ASSERT_EQUALS("", errout.str());
|
ASSERT_EQUALS("", errout.str());
|
||||||
|
|
||||||
|
// #11597
|
||||||
|
valueFlowUninit("void f(size_t f) {\n"
|
||||||
|
" struct {\n"
|
||||||
|
" int i;\n"
|
||||||
|
" enum { offset = 1062 };\n"
|
||||||
|
" } s;\n"
|
||||||
|
" if (f < s.offset + sizeof(s)) {}\n"
|
||||||
|
"}\n");
|
||||||
|
ASSERT_EQUALS("", errout.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void uninitvar_memberfunction() {
|
void uninitvar_memberfunction() {
|
||||||
|
|
Loading…
Reference in New Issue