Added test cases for #4801 (Cppcheck fails to parse Posix (crash in CheckOther::checkPipeParameterSize()))
This commit is contained in:
parent
545aad579f
commit
3e9f6daa00
|
@ -6097,6 +6097,23 @@ private:
|
||||||
"}\n");
|
"}\n");
|
||||||
ASSERT_EQUALS("", errout.str());
|
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
|
void checkCastIntToCharAndBack() { // #160
|
||||||
|
|
Loading…
Reference in New Issue