From 37eb0d4948dad6d2399915fde6eb5800c3fe825b Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Wed, 3 Apr 2024 16:38:57 +0800 Subject: [NFC] Check the nullness of pointer before dereference it in the assertion This was part of https://github.com/llvm/llvm-project/pull/85050. It is suggested to split the unrelated change as much as possible. So here is the patch. --- clang/lib/Serialization/GeneratePCH.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang') diff --git a/clang/lib/Serialization/GeneratePCH.cpp b/clang/lib/Serialization/GeneratePCH.cpp index fa71226..2fece29 100644 --- a/clang/lib/Serialization/GeneratePCH.cpp +++ b/clang/lib/Serialization/GeneratePCH.cpp @@ -102,7 +102,7 @@ ReducedBMIGenerator::ReducedBMIGenerator(Preprocessor &PP, Module *ReducedBMIGenerator::getEmittingModule(ASTContext &Ctx) { Module *M = Ctx.getCurrentNamedModule(); - assert(M->isNamedModuleUnit() && + assert(M && M->isNamedModuleUnit() && "ReducedBMIGenerator should only be used with C++20 Named modules."); return M; } -- cgit v1.1