Fixed #1720 (segmentation fault of cppcheck)

This commit is contained in:
Daniel Marjamäki 2010-06-02 18:10:32 +02:00
parent 5789eb116d
commit cb43168d81
2 changed files with 15 additions and 15 deletions

View File

@ -523,6 +523,7 @@ void Variables::alias(unsigned int varid1, unsigned int varid2)
{
VariableUsage *temp = find(*i);
if (temp)
temp->_aliases.erase(var1->_name->varId());
}

View File

@ -1147,8 +1147,7 @@ private:
void localvar17() // ticket #1720
{
// FIXME: Don't crash when checking the code below!
/*
// Don't crash when checking the code below!
functionVariableUsage("void foo()\n"
"{\n"
" struct DATA *data;\n"
@ -1160,7 +1159,7 @@ private:
" data->info = k;\n"
" line_start = ptr;\n"
"}\n");
*/
ASSERT_EQUALS("[test.cpp:6]: (style) Variable 'line_start' is assigned a value that is never used\n", errout.str());
}
void localvaralias1()