re PR fortran/19269 (transpose(reshape(...)) of character array segfaults.)
PR fortran/19269 * simplify.c (gfc_simplify_transpose): Set the result's typespec from the source, not the first element of the return value. From-SVN: r103982
This commit is contained in:
parent
f7683d376f
commit
d1d26ecf9f
|
@ -1,3 +1,9 @@
|
|||
2005-09-06 Richard Sandiford <richard@codesourcery.com>
|
||||
|
||||
PR fortran/19269
|
||||
* simplify.c (gfc_simplify_transpose): Set the result's typespec from
|
||||
the source, not the first element of the return value.
|
||||
|
||||
2005-09-04 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de>
|
||||
|
||||
PR fortran/23661
|
||||
|
|
|
@ -2858,7 +2858,7 @@ inc:
|
|||
for (i = 0; i < rank; i++)
|
||||
mpz_init_set_ui (e->shape[i], shape[i]);
|
||||
|
||||
e->ts = head->expr->ts;
|
||||
e->ts = source->ts;
|
||||
e->rank = rank;
|
||||
|
||||
return e;
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
2005-09-06 Richard Sandiford <richard@codesourcery.com>
|
||||
|
||||
PR fortran/19269
|
||||
* gfortran.fortran-torture/execute/pr19269-1.f90: New test.
|
||||
|
||||
2005-09-06 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR c/23075
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
program main
|
||||
call test (reshape ((/ 'a', 'b', 'c', 'd' /), (/ 2, 2 /)))
|
||||
contains
|
||||
subroutine test (a)
|
||||
character (len = *), dimension (:, :) :: a
|
||||
|
||||
if (size (a, 1) .ne. 2) call abort
|
||||
if (size (a, 2) .ne. 2) call abort
|
||||
if (len (a) .ne. 1) call abort
|
||||
|
||||
if (a (1, 1) .ne. 'a') call abort
|
||||
if (a (2, 1) .ne. 'b') call abort
|
||||
if (a (1, 2) .ne. 'c') call abort
|
||||
if (a (2, 2) .ne. 'd') call abort
|
||||
end subroutine test
|
||||
end program main
|
Loading…
Reference in New Issue