Fixed #1673 (Tokenizer::simplifyTypedef causes segfault for boost library)
This commit is contained in:
parent
f8442391af
commit
9dfbd3946a
|
@ -1019,7 +1019,7 @@ void Tokenizer::simplifyTypedef()
|
|||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
else if (tok2->previous()->str() != ".")
|
||||
{
|
||||
simplifyType = true;
|
||||
}
|
||||
|
|
|
@ -190,6 +190,7 @@ private:
|
|||
TEST_CASE(simplifyTypedef45); // ticket #1613
|
||||
TEST_CASE(simplifyTypedef46); // ticket #1615
|
||||
TEST_CASE(simplifyTypedef47);
|
||||
TEST_CASE(simplifyTypedef48); // ticket #1673
|
||||
|
||||
TEST_CASE(simplifyTypedefFunction);
|
||||
|
||||
|
@ -3970,6 +3971,23 @@ private:
|
|||
}
|
||||
}
|
||||
|
||||
void simplifyTypedef48() // ticket #1673
|
||||
{
|
||||
const char code[] = "typedef struct string { } string;\n"
|
||||
"void foo (LIST *module_name)\n"
|
||||
"{\n"
|
||||
" bar(module_name ? module_name->string : 0);\n"
|
||||
"}\n";
|
||||
|
||||
// The expected result..
|
||||
const std::string expected("struct string { } ; ; "
|
||||
"void foo ( LIST * module_name ) "
|
||||
"{ "
|
||||
"bar ( module_name ? module_name . string : 0 ) ; "
|
||||
"}");
|
||||
ASSERT_EQUALS(expected, sizeof_(code));
|
||||
}
|
||||
|
||||
void simplifyTypedefFunction()
|
||||
{
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue