#6659 heap user after free: kernel: sm750_accel.c. Add testcase.

This commit is contained in:
Alexander Mai 2015-05-10 11:37:23 +02:00
parent 075b07fb6c
commit 8fa7b13a18
1 changed files with 12 additions and 0 deletions

View File

@ -473,6 +473,7 @@ private:
TEST_CASE(removeMacroInClassDef); // #6058
TEST_CASE(sizeofAddParentheses);
TEST_CASE(incompleteTernary); // #6659
}
std::string tokenizeAndStringify(const char code[], bool simplify = false, bool expand = true, Settings::PlatformType platform = Settings::Unspecified, const char* filename = "test.cpp", bool cpp11 = true) {
@ -8726,6 +8727,17 @@ private:
"CS_PLUGIN_NAMESPACE_END(csparser)\n";
tokenizeAndStringify(code, true);
}
// #6659 heap user after free: kernel: sm750_accel.c
void incompleteTernary() {
const char * code = "void hw_copyarea() {\n"
" de_ctrl = (nDirection == RIGHT_TO_LEFT) ?\n"
" ( (0 & ~(((1 << (1 - (0 ? DE_CONTROL_DIRECTION))) - 1) << (0 ? DE_CONTROL_DIRECTION))) )\n"
" : 42;\n"
"}";
tokenizeAndStringify(code, true);
}
};
REGISTER_TEST(TestTokenizer)