<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/104798>104798</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Flang crashes when calling procedure dummy argument
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            flang
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          everythingfunctional
      </td>
    </tr>
</table>

<pre>
    I've documented the issue in [another repo](https://github.com/HPC-Bugs/reproducers/tree/main/compiler/Fortran/flang/mapped-object-invalid-permission), but the following example reproduces the issue.

```fortran
module example_mod
    abstract interface
        subroutine sub_i
 end subroutine
    end interface
contains
    subroutine call_internal(string)
        character(len=*), intent(in) :: string
 call call_it(print_it)
    contains
        subroutine print_it
            print *, string
        end subroutine
    end subroutine
    subroutine call_it(sub)
        procedure(sub_i) :: sub
        call sub
    end subroutine
end module

program example_prog
    use example_mod
    call call_internal("Hello")
end program
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx8VN1uszgQfRpzYyUyBhK44CJthLp3-waRwQN4ZWzkn3T79qshbEjSfrWiAPN3jo_HI7xXgwGoSfFGinMiYhitq-EK7iuMygx9NF1Q1gidtFZ-1X8RfrwClbaLE5gAkoYRqPI-AlWGkuJNGBtGcNTBbElxJrwcQ5g9yU6EN4Q3gwpjbPednQhvPv5-373FwRPeOJidlbEDh1_BARDeTEIZwpvOTrPS4AhvGuuCE2jstTDDEjPPIHe2_Qe6sFPmKrSSuxncpLxX1hBeEf5O2xgWrr3V2n4qM1D4V0yzBnpH9ttm9oSdCTut_wd2-_Ur-GKdrIwa_q9ymay82SmlVLQ-ONEFqkwA14sONh8uH1tnY1AG8PWiVi8Y-eDaUtD-UqmzJghl_Bb0ULMTWl-WBCM04aUPTqFW1TOLbhRIEnUtNRiSnQk_rXJhtgmEl3gAFcXjy050LXSrgigrFAbOTpmwvD7AfKf5QvWe9RSAa_HQhdH7M_C6flPrJ_s3gZC1j-03XWZnO5DRwc1_UY8KxPZFRFThyfoTPtpuDfPYWLOzgxPTvYfwe6sT_R-660H47YwJ5x-gtSWc3zeEqCvGSycnss5klVUigTo98pyVrGQsGWuR5ZIdyqrP-sOxEEV-AMjlEcrqmImU54mqOcP4tEoLzhjbp8cUyqxI0zat0j7nJGcwCaX3Wl-nvXVDstyoOmX5sSoTLVrQfhk4nK93mOPscTUm7FocBznTyge_lQgqaKgbDKedE34ETz9HMIsMeJnvZ0ZlnKYvKtywTKgkOl3_MoEQYX3sZmdxhhDeLIxxDq2krzX_LwAA___GwJ7z">