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,9 +450,10 @@ CXString clang_getDiagnosticFixIt(CXDiagnostic Diag, unsigned FixIt,
|
||||||
}
|
}
|
||||||
|
|
||||||
void clang_disposeDiagnosticSet(CXDiagnosticSet Diags) {
|
void clang_disposeDiagnosticSet(CXDiagnosticSet Diags) {
|
||||||
CXDiagnosticSetImpl *D = static_cast<CXDiagnosticSetImpl*>(Diags);
|
if (CXDiagnosticSetImpl *D = static_cast<CXDiagnosticSetImpl *>(Diags)) {
|
||||||
if (D->isExternallyManaged())
|
if (D->isExternallyManaged())
|
||||||
delete D;
|
delete D;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CXDiagnostic clang_getDiagnosticInSet(CXDiagnosticSet Diags,
|
CXDiagnostic clang_getDiagnosticInSet(CXDiagnosticSet Diags,
|
||||||
|
|
Loading…
Reference in New Issue