From 112b35a49ee392111479894fac13eb915e9138f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Sat, 30 Jan 2016 18:20:45 +0100 Subject: [PATCH] testrunner: add testcode for #6781 (TemplateSimplifier::simplifyTemplateInstantiations causes heap corruption on invalid code) --- test/testgarbage.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/testgarbage.cpp b/test/testgarbage.cpp index 145dc2e20..2ed5034d5 100644 --- a/test/testgarbage.cpp +++ b/test/testgarbage.cpp @@ -221,6 +221,7 @@ private: TEST_CASE(garbageCode170); TEST_CASE(garbageCode171); TEST_CASE(garbageCode172); + TEST_CASE(garbageCode173); // #6781 TEST_CASE(garbageValueFlow); TEST_CASE(garbageSymbolDatabase); TEST_CASE(garbageAST); @@ -1454,6 +1455,11 @@ private: ASSERT_THROW(checkCode("p>,"), InternalError); } + void garbageCode173() { + // #6781 heap corruption ; TemplateSimplifier::simplifyTemplateInstantiations + ASSERT_THROW(checkCode(" template < Types > struct S : >( S < ...Types... > S <) > { ( ) { } } ( ) { return S < void > ( ) }"), InternalError); + } + }; REGISTER_TEST(TestGarbage)