Skip to content

Commit 8d24800

Browse files
committed
[flang][nfc] Add an assert to guard against nullptr dereferencing
Differential Revision: https://reviews.llvm.org/D119133
1 parent a33e985 commit 8d24800

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

flang/include/flang/Lower/Bridge.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,10 @@ class LoweringBridge {
6464
//===--------------------------------------------------------------------===//
6565

6666
mlir::MLIRContext &getMLIRContext() { return context; }
67-
mlir::ModuleOp &getModule() { return *module.get(); }
67+
mlir::ModuleOp &getModule() {
68+
assert(module && "This bridge is missing an MLIR module");
69+
return *module.get();
70+
}
6871
const Fortran::common::IntrinsicTypeDefaultKinds &getDefaultKinds() const {
6972
return defaultKinds;
7073
}

0 commit comments

Comments
 (0)