danmar/cppcheck — pull request #148 by JustRamires (2013-07-05 12:03:17+00:00)
Title: Fixed segmentation fault in SymbolDatabase::SymbolDatabase(Ticket #4892)

Ticket:
http://sourceforge.net/apps/trac/cppcheck/ticket/4892

Problem:
equal to Ticket #4694(https://github.com/danmar/cppcheck/pull/139), but in another place
(https://github.com/danmar/cppcheck/blob/d96fb577cd87dd9b11477a361ff4dffeeeeb8b20/lib/symboldatabase.cpp#L745):
```c
for (std::list::iterator it = scopeList.begin(); it != scopeList.end(); ++it) {
scope = &(*it);

if (scope->isClassOrStruct() && scope->definedType->needInitialization == Type::Unknown) {
```
scope->definedType = 0x0;

The code contains 61 references to scope->definedType. I don't think it would be right to change them all from
```c
if (scope->isClassOrStruct() && scope->definedType->needInitialization == Type::Unknown) {
```
to
```c
if (scope->isClassOrStruct() && scope->definedType && scope->definedType->needInitialization == Type::Unknown) {
```

I could be wrong, but that's my solution to the problem:
create blank Type for scopes without Type.