forked from OSchip/llvm-project
libclang: fix a crash in clang_disposeDiagnosticSet when it is passed a NULL argument
llvm-svn: 201236
This commit is contained in:
parent
254c7636cf
commit
371c217b3f
|
@ -450,10 +450,11 @@ CXString clang_getDiagnosticFixIt(CXDiagnostic Diag, unsigned FixIt,
|
|||
}
|
||||
|
||||
void clang_disposeDiagnosticSet(CXDiagnosticSet Diags) {
|
||||
CXDiagnosticSetImpl *D = static_cast<CXDiagnosticSetImpl*>(Diags);
|
||||
if (CXDiagnosticSetImpl *D = static_cast<CXDiagnosticSetImpl *>(Diags)) {
|
||||
if (D->isExternallyManaged())
|
||||
delete D;
|
||||
}
|
||||
}
|
||||
|
||||
CXDiagnostic clang_getDiagnosticInSet(CXDiagnosticSet Diags,
|
||||
unsigned Index) {
|
||||
|
|
Loading…
Reference in New Issue