diff options
author | Chuanqi Xu <yedeng.yd@linux.alibaba.com> | 2024-04-03 16:38:57 +0800 |
---|---|---|
committer | Chuanqi Xu <yedeng.yd@linux.alibaba.com> | 2024-04-03 16:39:02 +0800 |
commit | 37eb0d4948dad6d2399915fde6eb5800c3fe825b (patch) | |
tree | 5be98a14518a690287365c1aa48373e7521be6c2 /clang | |
parent | 72c29fa9e226a928b3d3a01d74f6b44a0b31b7d4 (diff) | |
download | llvm-37eb0d4948dad6d2399915fde6eb5800c3fe825b.zip llvm-37eb0d4948dad6d2399915fde6eb5800c3fe825b.tar.gz llvm-37eb0d4948dad6d2399915fde6eb5800c3fe825b.tar.bz2 |
[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.
Diffstat (limited to 'clang')
-rw-r--r-- | clang/lib/Serialization/GeneratePCH.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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; } |