Added testcases for #4801 (Cppcheck fails to parse Posix (crash in CheckOther::checkPipeParameterSize()))

This commit is contained in:
Alexander Mai 2013-08-22 21:33:02 +02:00 committed by Daniel Marjamäki
parent 986ec42d79
commit 7fc6b1344b
1 changed files with 17 additions and 0 deletions

View File

@ -6157,6 +6157,23 @@ private:
"}\n");
ASSERT_EQUALS("", errout.str());
// avoid crash with pointer variable - for local variable on stack as well - see #4801
check("void foo {\n"
" int *cp;\n"
" if ( pipe (cp) == -1 ) {\n"
" return;\n"
" }\n"
"}\n");
ASSERT_EQUALS("", errout.str());
// test with unknown variable
check("void foo {\n"
" if ( pipe (cp) == -1 ) {\n"
" return;\n"
" }\n"
"}\n");
ASSERT_EQUALS("", errout.str());
}
void checkCastIntToCharAndBack() { // #160