Skip to content

Commit

Permalink
[NFC] Check the nullness of pointer before dereference it in the asse…
Browse files Browse the repository at this point in the history
…rtion

This was part of #85050.

It is suggested to split the unrelated change as much as possible. So
here is the patch.
  • Loading branch information
ChuanqiXu9 committed Apr 3, 2024
1 parent 72c29fa commit 37eb0d4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion clang/lib/Serialization/GeneratePCH.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 37eb0d4

Please sign in to comment.