diff options
author | Chris Lattner <sabre@nondot.org> | 2008-11-18 17:18:16 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-11-18 17:18:16 +0000 |
commit | aabb54e1ee8e2c2ef89e7c5cbbb9a89872e96f67 (patch) | |
tree | 012c7bfd51e16f8ddf012d35f2d4fe196f8d0f1c | |
parent | 10c4262aeb5212375e3fa64e76887bd9bcc79924 (diff) |
don't dereference a null pointer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59533 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/clang/Basic/Diagnostic.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/clang/Basic/Diagnostic.h b/include/clang/Basic/Diagnostic.h index fb1d7a629e..fb3e5953da 100644 --- a/include/clang/Basic/Diagnostic.h +++ b/include/clang/Basic/Diagnostic.h @@ -214,6 +214,7 @@ class DiagnosticInfo { public: DiagnosticInfo(Diagnostic *diagObj, FullSourceLoc loc, unsigned diagID) : DiagObj(diagObj), Loc(loc), DiagID(diagID) { + if (DiagObj == 0) return; assert(DiagObj->NumDiagArgs == -1 && "Multiple diagnostics in flight at once!"); DiagObj->NumDiagArgs = DiagObj->NumDiagRanges = 0; |