2 ! PR
97799 - this used
to segfault intermittently
.
3 ! Test case by George Hockney
.
7 character *(20) CA
(4) ! four cells of length
20
9 call CHAR_ENTRY
(CA
) ! call char_sub through entry
11 write (*,*) CA
! write result
-- not needed
for bug
12 call CHAR_SUB
(CA
) ! call char_sb directly
-- not needed
13 write (*,*) CA
! write result
-- not needed
for bug
19 SUBROUTINE CHAR_SUB
(CARRAY
) ! sets carray cells
to 'Something'
22 CHARACTER*
(*) CARRAY
(*)
27 nelts
= 4 ! same as size of array in main
program
28 write (*,*) 'CHAR_SUB'
29 write (*,*) 'len(carray(1))', len
(carray
(1)) ! len is OK at
20
30 call flush
() ! since the next loop segfaults
32 CARRAY
(i
) = 'Something'
40 ! TOP_ENTRY is never called directly
. It organizes entry points
41 ! and sometimes saves variables
for other entry points
. Its
42 ! signature does not matter
for the failure
46 ! Declare input variables
for all entry points
. Just one here
48 CHARACTER*
(*) CARRAY
(*)
50 ! Entry point CHAR_ENTRY
52 ENTRY CHAR_ENTRY
( CARRAY
)
56 END SUBROUTINE TOP_ENTRY