Skip to content

Commit 835c45e

Browse files
committed
[mlir] Fix possible null dereference during error logging
1 parent 6c0f7a5 commit 835c45e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mlir/lib/Conversion/MPIToLLVM/MPIToLLVM.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,8 @@ std::unique_ptr<MPIImplTraits> MPIImplTraits::get(ModuleOp &moduleOp) {
405405
return std::make_unique<OMPIImplTraits>(moduleOp);
406406
if (!strAttr || strAttr.getValue() != "MPICH")
407407
moduleOp.emitWarning() << "Unknown \"MPI:Implementation\" value in DLTI ("
408-
<< strAttr.getValue() << "), defaulting to MPICH";
408+
<< (strAttr ? strAttr.getValue() : "<NULL>")
409+
<< "), defaulting to MPICH";
409410
return std::make_unique<MPICHImplTraits>(moduleOp);
410411
}
411412

0 commit comments

Comments
 (0)