Fixed false positive: Bailout in checkuninitvar.cpp if setjmp is found
This commit is contained in:
parent
8f1e44f1b7
commit
ecb9d87e42
|
@ -1432,8 +1432,8 @@ bool CheckUninitVar::checkScopeForVariable(const Scope* scope, const Token *tok,
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// bailout if there is assembler code
|
// bailout if there is assembler code or setjmp
|
||||||
if (Token::simpleMatch(tok, "asm (")) {
|
if (Token::Match(tok, "asm|setjmp (")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -620,7 +620,7 @@ private:
|
||||||
" a = 1;\n"
|
" a = 1;\n"
|
||||||
" longjmp(env, 1);\n"
|
" longjmp(env, 1);\n"
|
||||||
"}");
|
"}");
|
||||||
TODO_ASSERT_EQUALS("", "[test.cpp:7]: (error) Uninitialized variable: a\n", errout.str());
|
ASSERT_EQUALS("", errout.str());
|
||||||
|
|
||||||
// macro_for..
|
// macro_for..
|
||||||
checkUninitVarB("int foo()\n"
|
checkUninitVarB("int foo()\n"
|
||||||
|
|
Loading…
Reference in New Issue