forked from OSchip/llvm-project
[analyzer] Fix a crash in plist-html generation introduced in r162939.
Basically, do the correct thing to fix the XML generation error, rather than making it even worse by unilaterally dereferencing a null pointer. llvm-svn: 162964
This commit is contained in:
parent
e423e865fe
commit
7444f5d826
|
@ -500,21 +500,22 @@ void PlistDiagnostics::FlushDiagnosticsImpl(
|
|||
if (!filesMade->empty()) {
|
||||
StringRef lastName;
|
||||
PDFileEntry::ConsumerFiles *files = filesMade->getFiles(*D);
|
||||
for (PDFileEntry::ConsumerFiles::const_iterator CI = files->begin(),
|
||||
CE = files->end(); CI != CE; ++CI) {
|
||||
StringRef newName = CI->first;
|
||||
if (newName != lastName) {
|
||||
if (!lastName.empty()) {
|
||||
o << " </array>\n";
|
||||
if (files) {
|
||||
for (PDFileEntry::ConsumerFiles::const_iterator CI = files->begin(),
|
||||
CE = files->end(); CI != CE; ++CI) {
|
||||
StringRef newName = CI->first;
|
||||
if (newName != lastName) {
|
||||
if (!lastName.empty()) {
|
||||
o << " </array>\n";
|
||||
}
|
||||
lastName = newName;
|
||||
o << " <key>" << lastName << "_files</key>\n";
|
||||
o << " <array>\n";
|
||||
}
|
||||
lastName = newName;
|
||||
o << " <key>" << lastName << "_files</key>\n";
|
||||
o << " <array>\n";
|
||||
o << " <string>" << CI->second << "</string>\n";
|
||||
}
|
||||
o << " <string>" << CI->second << "</string>\n";
|
||||
}
|
||||
if (!lastName.empty())
|
||||
o << " </array>\n";
|
||||
}
|
||||
}
|
||||
|
||||
// Close up the entry.
|
||||
|
|
Loading…
Reference in New Issue