Skip to content

Commit 112b35a

Browse files
committed
testrunner: add testcode for #6781 (TemplateSimplifier::simplifyTemplateInstantiations causes heap corruption on invalid code)
1 parent b82bdb2 commit 112b35a

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

test/testgarbage.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ class TestGarbage : public TestFixture {
221221
TEST_CASE(garbageCode170);
222222
TEST_CASE(garbageCode171);
223223
TEST_CASE(garbageCode172);
224+
TEST_CASE(garbageCode173); // #6781
224225
TEST_CASE(garbageValueFlow);
225226
TEST_CASE(garbageSymbolDatabase);
226227
TEST_CASE(garbageAST);
@@ -1454,6 +1455,11 @@ class TestGarbage : public TestFixture {
14541455
ASSERT_THROW(checkCode("p<e T=l[<]<>>,"), InternalError);
14551456
}
14561457

1458+
void garbageCode173() {
1459+
// #6781 heap corruption ; TemplateSimplifier::simplifyTemplateInstantiations
1460+
ASSERT_THROW(checkCode(" template < Types > struct S : >( S < ...Types... > S <) > { ( ) { } } ( ) { return S < void > ( ) }"), InternalError);
1461+
}
1462+
14571463
};
14581464

14591465
REGISTER_TEST(TestGarbage)

0 commit comments

Comments
 (0)