Added testcases for #4801 (Cppcheck fails to parse Posix (crash in CheckOther::checkPipeParameterSize()))
This commit is contained in:
parent
986ec42d79
commit
7fc6b1344b
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue