Fixed #2252 (segmentation fault with enable=all)
This commit is contained in:
parent
f90236a183
commit
43dcc51752
|
@ -710,9 +710,21 @@ const Token *SymbolDatabase::initBaseInfo(SpaceInfo *info, const Token *tok)
|
|||
// don't add unhandled templates
|
||||
if (tok2->next()->str() == "<")
|
||||
{
|
||||
while (tok2->str() != ">")
|
||||
int level1 = 1;
|
||||
while (tok2->next())
|
||||
{
|
||||
if (tok2->next()->str() == ">")
|
||||
{
|
||||
level1--;
|
||||
if (level == 0)
|
||||
break;
|
||||
}
|
||||
else if (tok2->next()->str() == "<")
|
||||
level1++;
|
||||
|
||||
tok2 = tok2->next();
|
||||
}
|
||||
}
|
||||
|
||||
// save pattern for base class name
|
||||
else
|
||||
|
|
|
@ -173,6 +173,7 @@ private:
|
|||
TEST_CASE(symboldatabase5); // ticket #2178
|
||||
TEST_CASE(symboldatabase6); // ticket #2221
|
||||
TEST_CASE(symboldatabase7); // ticket #2230
|
||||
TEST_CASE(symboldatabase8); // ticket #2252
|
||||
}
|
||||
|
||||
// Check the operator Equal
|
||||
|
@ -4956,6 +4957,21 @@ private:
|
|||
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
|
||||
void symboldatabase8()
|
||||
{
|
||||
// ticket #2252 - segmentation fault
|
||||
checkConst("struct PaletteColorSpaceHolder: public rtl::StaticWithInit<uno::Reference<rendering::XColorSpace>,\n"
|
||||
" PaletteColorSpaceHolder>\n"
|
||||
"{\n"
|
||||
" uno::Reference<rendering::XColorSpace> operator()()\n"
|
||||
" {\n"
|
||||
" return vcl::unotools::createStandardColorSpace();\n"
|
||||
" }\n"
|
||||
"};\n");
|
||||
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
};
|
||||
|
||||
REGISTER_TEST(TestClass)
|
||||
|
|
Loading…
Reference in New Issue