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

via flang-commits flang-commits at lists.llvm.org
Wed Jan 22 01:54:09 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);
----------------
jeanPerier wrote:

If there is an easy way, it would be nice to point at the previous initialization in an attachment (but If I am understanding details.init() correctly, you probably do not have that info here).

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


More information about the flang-commits mailing list