Fixed false positive: Bailout in checkuninitvar.cpp if setjmp is found

This commit is contained in:
PKEuS 2015-01-21 16:49:34 +01:00
parent 8f1e44f1b7
commit ecb9d87e42
2 changed files with 3 additions and 3 deletions

View File

@ -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;
} }

View File

@ -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"