blob: 3e2a0245afbf4cd793529f8f1e8f5a3d182a1766 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
! { dg-do run }
!
! PR fortran/90076
!
! Contributed by Brad Richardson <everythingfunctional@protonmail.com>
!
program assignment_memory_leak
implicit none
type, abstract :: base
end type base
type, extends(base) :: extended
end type extended
call run()
contains
subroutine run()
class(base), allocatable :: var
var = newVar() ! Crash fixed
end subroutine run
function newVar()
class(extended), allocatable :: newVar
end function newVar
end program assignment_memory_leak
|