!======================================================================= ! FILE: TEST20.FOR ! DATE: 21 July 2003 ! ! TEST: Fortran 95 illegal pointer usage. ! ! Contact: Mark Stevens Salford Software Ltd !======================================================================= program pointers implicit none integer, pointer :: p2(:) => null() call sub call sub1 print *, "Test20: Illegal use of pointers not detected." contains subroutine sub integer, target :: p1(40) p2 => p1 p1 = 32 end subroutine subroutine sub1 call corrupt_stack end subroutine sub1 ! ! The following function can overwrite its return address. ! subroutine corrupt_stack p2 = 1234 end subroutine corrupt_stack end