#8383: Segmentation fault on garbage code. Added regression test.

This commit is contained in:
orbitcowboy 2018-09-10 16:28:32 +02:00
parent 95da9f77c4
commit 399a90c00e
1 changed files with 11 additions and 0 deletions

View File

@ -228,6 +228,7 @@ private:
TEST_CASE(garbageCode195); // #8709
TEST_CASE(garbageCode196); // #8265
TEST_CASE(garbageCode197); // #8385
TEST_CASE(garbageCode198); // #8383
TEST_CASE(garbageCodeFuzzerClientMode1); // test cases created with the fuzzer client, mode 1
@ -1529,6 +1530,16 @@ private:
ASSERT_THROW(checkCode("(){e break,{(case)|{e:[()]}}}"), InternalError);
}
// #8383
void garbageCode198() {
ASSERT_THROW(checkCode("void f(){\n"
"x= ={(continue continue { ( struct continue { ( ++ name5 name5 ) ( name5 name5 n\n"
"ame5 ( name5 struct ( name5 name5 < ) ) ( default ) { name4 != name5 name5 name5\n"
" ( name5 name5 name5 ( { 1 >= void { ( ()) } 1 name3 return >= >= ( ) >= name5 (\n"
" name5 name6 :nam00 [ ()])}))})})})};\n"
"}"), InternalError);
}
void syntaxErrorFirstToken() {
ASSERT_THROW(checkCode("&operator(){[]};"), InternalError); // #7818
ASSERT_THROW(checkCode("*(*const<> (size_t); foo) { } *(*const (size_t)() ; foo) { }"), InternalError); // #6858