Description
MRE
program move_alloc
implicit none
integer, allocatable :: a(:), b(:)
allocate(a(3))
a = [1, 2, 3]
call move_alloc(a, b)
print *, b
end program move_alloc
LFortran
(lf) harshil-shah@harshil-shah-HP-Pavilion-Laptop-15-eg2xxx:~/lfortran$ lfortran a.f90
Segmentation fault (core dumped)
GFortran
(lf) harshil-shah@harshil-shah-HP-Pavilion-Laptop-15-eg2xxx:~/lfortran$ gfortran a.f90 && ./a.out
1 2 3
If we allocate b
before calling move_alloc
, then it does not segfault.
Metadata
Metadata
Assignees
Labels
No labels