Uninitialized variables; Fixed FP for range for loop
This commit is contained in:
parent
7d84b8f1bc
commit
a4653a057a
|
@ -1528,6 +1528,8 @@ void CheckUninitVar::valueFlowUninit()
|
|||
continue;
|
||||
if (v->indirect > 1 || v->indirect < 0)
|
||||
continue;
|
||||
if (v->indirect == 0 && !isVariableUsage(tok, tok->valueType() && tok->valueType()->pointer > 0, NO_ALLOC))
|
||||
continue;
|
||||
bool uninitderef = false;
|
||||
if (tok->variable()) {
|
||||
bool unknown;
|
||||
|
|
|
@ -4639,6 +4639,13 @@ private:
|
|||
"}");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
// range for..
|
||||
valueFlowUninit("void f() {\n"
|
||||
" X *item;\n"
|
||||
" for (item: itemList) {}\n"
|
||||
"}");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
// macro_for..
|
||||
valueFlowUninit("int foo()\n"
|
||||
"{\n"
|
||||
|
|
Loading…
Reference in New Issue