Skip to content

Commit 37eb0d4

Browse files
committed
[NFC] Check the nullness of pointer before dereference it in the assertion
This was part of #85050. It is suggested to split the unrelated change as much as possible. So here is the patch.
1 parent 72c29fa commit 37eb0d4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clang/lib/Serialization/GeneratePCH.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ ReducedBMIGenerator::ReducedBMIGenerator(Preprocessor &PP,
102102

103103
Module *ReducedBMIGenerator::getEmittingModule(ASTContext &Ctx) {
104104
Module *M = Ctx.getCurrentNamedModule();
105-
assert(M->isNamedModuleUnit() &&
105+
assert(M && M->isNamedModuleUnit() &&
106106
"ReducedBMIGenerator should only be used with C++20 Named modules.");
107107
return M;
108108
}

0 commit comments

Comments
 (0)