diff --git a/flang/include/flang/Lower/Bridge.h b/flang/include/flang/Lower/Bridge.h --- a/flang/include/flang/Lower/Bridge.h +++ b/flang/include/flang/Lower/Bridge.h @@ -64,7 +64,10 @@ //===--------------------------------------------------------------------===// mlir::MLIRContext &getMLIRContext() { return context; } - mlir::ModuleOp &getModule() { return *module.get(); } + mlir::ModuleOp &getModule() { + assert(module && "This bridge is missing an MLIR module"); + return *module.get(); + } const Fortran::common::IntrinsicTypeDefaultKinds &getDefaultKinds() const { return defaultKinds; }