From aabb54e1ee8e2c2ef89e7c5cbbb9a89872e96f67 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 18 Nov 2008 17:18:16 +0000 Subject: [PATCH] don't dereference a null pointer git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59533 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Basic/Diagnostic.h | 1 + 1 file changed, 1 insertion(+) 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;