add testcase for #6011 (crash in libreoffice, failure to create AST for comparison) which I still had in some branch.

This commit is contained in:
Matthias Krüger 2017-01-08 02:36:21 +01:00
parent 064a4aa4cc
commit d4dcef4a30
1 changed files with 13 additions and 0 deletions

View File

@ -213,6 +213,7 @@ private:
TEST_CASE(garbageCode182); // #4195 TEST_CASE(garbageCode182); // #4195
TEST_CASE(garbageCode183); // #7505 TEST_CASE(garbageCode183); // #7505
TEST_CASE(garbageCode184); // #7699 TEST_CASE(garbageCode184); // #7699
TEST_CASE(garbageCode185); // #6011
TEST_CASE(garbageValueFlow); TEST_CASE(garbageValueFlow);
TEST_CASE(garbageSymbolDatabase); TEST_CASE(garbageSymbolDatabase);
TEST_CASE(garbageAST); TEST_CASE(garbageAST);
@ -1407,6 +1408,18 @@ private:
"}"); "}");
} }
void garbageCode185() { // #6011 crash in libreoffice failure to create proper AST
checkCode(
"namespace binfilter\n"
"{\n"
" BOOL EnhWMFReader::ReadEnhWMF()\n"
" {\n"
" pOut->CreateObject( nIndex, GDI_BRUSH, new WinMtfFillStyle( ReadColor(), ( nStyle == BS_HOLLOW ) ? TRUE : FALSE ) );\n"
" return bStatus;\n"
" };\n"
"}\n");
}
void syntaxErrorFirstToken() { void syntaxErrorFirstToken() {
ASSERT_THROW(checkCode("&operator(){[]};"), InternalError); // #7818 ASSERT_THROW(checkCode("&operator(){[]};"), InternalError); // #7818
ASSERT_THROW(checkCode("*(*const<> (size_t); foo) { } *(*const (size_t)() ; foo) { }"), InternalError); // #6858 ASSERT_THROW(checkCode("*(*const<> (size_t); foo) { } *(*const (size_t)() ; foo) { }"), InternalError); // #6858