 |
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
davidb
Joined: 17 Jul 2009 Posts: 560 Location: UK
|
Posted: Thu Jul 21, 2011 7:13 pm Post subject: Bug with host association and derived types |
|
|
I have encountered a strange bug with host association and derived types.
The following code illustrates the bug. When the six comment lines are uncommented, the first call to add_one does not occur and an "Access Violation" error is given in the debugger.
Note that the error occurs before the call to the contained subroutine bbb.
With the comments in place the call to add_one works.
Hopefully, this is a small enough sample to allow this to be debugged.
Best Regards
David.
Code: |
module foo
type wrap_type
integer :: n = 10
end type wrap_type
contains
subroutine add_one(w)
type(wrap_type), intent(inout) :: w
w%n = w%n + 1
end subroutine add_one
end module foo
module routines
contains
subroutine aaa(w)
use foo
type (wrap_type), intent(inout) :: w
call add_one(w) !< Access Violation occurs when following comments are removed.
!call bbb
!contains
! subroutine bbb
! call add_one(w)
! end subroutine bbb
end subroutine aaa
end module routines
program check
use foo
use routines
type (wrap_type) :: w
call aaa(w)
end program check
|
_________________ Programmer in: Fortran 77/95/2003/2008, C, C++ (& OpenMP), java, Python, Perl |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8208 Location: Salford, UK
|
Posted: Fri Jul 22, 2011 7:54 am Post subject: |
|
|
It looks to me like this bug has already been fixed for the next release.
I cannot reproduce it and I have fixed a similar bug recently. |
|
Back to top |
|
 |
davidb
Joined: 17 Jul 2009 Posts: 560 Location: UK
|
Posted: Fri Jul 22, 2011 6:02 pm Post subject: |
|
|
Thanks Paul.
I am using verion 6.1, so if you have a later, development version and the above works then you must have fixed it already.  _________________ Programmer in: Fortran 77/95/2003/2008, C, C++ (& OpenMP), java, Python, Perl |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|