Revert "Remove redundant safety logic (CID 1368511)"

This reverts commit d892031f28.
This commit is contained in:
Daniel Marjamäki 2017-09-19 23:13:31 +02:00
parent d892031f28
commit 1a057bc23a
2 changed files with 4 additions and 1 deletions

View File

@ -1127,6 +1127,9 @@ void SymbolDatabase::createSymbolDatabaseSetScopePointers()
start = const_cast<Token*>(_tokenizer->list.front());
end = const_cast<Token*>(_tokenizer->list.back());
}
assert((start == nullptr) == (end == nullptr));
if (start == nullptr)
continue;
start->scope(&*it);
end->scope(&*it);

View File

@ -2227,7 +2227,7 @@ private:
check("const char* foo() {\n"
" static std::string text;\n"
" text = \"hello world\\n\";\n"
" text = \"hello world\n\";\n"
" return text.c_str();\n"
"}");
ASSERT_EQUALS("", errout.str()); // #3427