[flang-commits] [flang] [Flang] Avoid crash when a function return is undefined (PR #151577)

Tom Eccles via flang-commits flang-commits at lists.llvm.org
Fri Aug 1 02:48:09 PDT 2025


================
@@ -1733,6 +1733,13 @@ class FirConverter : public Fortran::lower::AbstractConverter {
     mlir::Location loc = toLocation();
     if (!resultSymBox) {
       mlir::emitError(loc, "internal error when processing function return");
----------------
tblah wrote:

Do we still need this error? Printing it makes it look like there was a compiler bug, but I think returning `undef` is actually the correct thing here from a compiler perspective: so there was no internal error.

https://github.com/llvm/llvm-project/pull/151577


More information about the flang-commits mailing list