[flang-commits] [flang] [flang] Fix crash on erroneous program (PR #123843)

Peter Klausler via flang-commits flang-commits at lists.llvm.org
Wed Jan 22 11:02:47 PST 2025


================
@@ -8419,8 +8419,11 @@ void DeclarationVisitor::PointerInitialization(
     if (!context().HasError(ultimate)) {
       if (IsProcedurePointer(ultimate)) {
         auto &details{ultimate.get<ProcEntityDetails>()};
-        CHECK(!details.init());
-        if (const auto *targetName{std::get_if<parser::Name>(&target.u)}) {
+        if (details.init()) {
+          Say(name, "'%s' was previously initialized"_err_en_US);
----------------
klausler wrote:

I think the previous location is no longer available at this point; I couldn't figure out a way to find it, anyway.

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


More information about the flang-commits mailing list