don't dereference a null pointer

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59533 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2008-11-18 17:18:16 +00:00
Родитель 10c4262aeb
Коммит aabb54e1ee
1 изменённых файлов: 1 добавлений и 0 удалений

Просмотреть файл

@ -214,6 +214,7 @@ class DiagnosticInfo {
public: public:
DiagnosticInfo(Diagnostic *diagObj, FullSourceLoc loc, unsigned diagID) : DiagnosticInfo(Diagnostic *diagObj, FullSourceLoc loc, unsigned diagID) :
DiagObj(diagObj), Loc(loc), DiagID(diagID) { DiagObj(diagObj), Loc(loc), DiagID(diagID) {
if (DiagObj == 0) return;
assert(DiagObj->NumDiagArgs == -1 && assert(DiagObj->NumDiagArgs == -1 &&
"Multiple diagnostics in flight at once!"); "Multiple diagnostics in flight at once!");
DiagObj->NumDiagArgs = DiagObj->NumDiagRanges = 0; DiagObj->NumDiagArgs = DiagObj->NumDiagRanges = 0;