Fixed #5158 (segmentation fault (valid code))
This commit is contained in:
parent
bb746261d3
commit
687aeb4f5f
|
@ -622,6 +622,8 @@ static void eraseNotLocalArg(std::map<unsigned int, const Token*>& container, co
|
|||
|
||||
static void eraseMemberAssignments(const unsigned int varId, std::map<unsigned int, std::set<unsigned int> > &membervars, std::map<unsigned int, const Token*> &varAssignments)
|
||||
{
|
||||
if (varAssignments.empty() || membervars.empty())
|
||||
return;
|
||||
const std::map<unsigned int, std::set<unsigned int> >::const_iterator it = membervars.find(varId);
|
||||
if (it != membervars.end()) {
|
||||
const std::set<unsigned int> &v = it->second;
|
||||
|
|
|
@ -2146,6 +2146,20 @@ private:
|
|||
" }\n"
|
||||
"}", 0, false, false, false, false);
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
// Ticket #5158 "segmentation fault (valid code)"
|
||||
check("typedef struct ct_data_s {\n"
|
||||
" union {\n"
|
||||
" char freq;\n"
|
||||
" } fc;\n"
|
||||
"} ct_data;\n"
|
||||
"typedef struct internal_state {\n"
|
||||
" struct ct_data_s dyn_ltree[10];\n"
|
||||
"} deflate_state;\n"
|
||||
"void f(deflate_state *s) {\n"
|
||||
" s->dyn_ltree[0].fc.freq++;\n"
|
||||
"}\n", 0, false, false, false, false);
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
|
||||
void switchRedundantOperationTest() {
|
||||
|
|
Loading…
Reference in New Issue