File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -544,14 +544,17 @@ class FirConverter : public Fortran::lower::AbstractConverter {
544
544
genFIRConditionalBranch (cond, trueTarget->block , falseTarget->block );
545
545
}
546
546
547
- //
547
+ // ===----------------------------------------------------------------------===//
548
548
// Termination of symbolically referenced execution units
549
- //
549
+ // ===----------------------------------------------------------------------===//
550
550
551
551
// / END of program
552
552
// /
553
553
// / Generate the cleanup block before the program exits
554
- void genExitRoutine () { builder->create <mlir::ReturnOp>(toLocation ()); }
554
+ void genExitRoutine () {
555
+ if (blockIsUnterminated ())
556
+ builder->create <mlir::ReturnOp>(toLocation ());
557
+ }
555
558
void genFIR (const Fortran::parser::EndProgramStmt &) { genExitRoutine (); }
556
559
557
560
// / END of procedure-like constructs
You can’t perform that action at this time.
0 commit comments