replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - Bug with host association and derived types
forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Bug with host association and derived types

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
davidb



Joined: 17 Jul 2009
Posts: 560
Location: UK

PostPosted: Thu Jul 21, 2011 7:13 pm    Post subject: Bug with host association and derived types Reply with quote

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
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8208
Location: Salford, UK

PostPosted: Fri Jul 22, 2011 7:54 am    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
davidb



Joined: 17 Jul 2009
Posts: 560
Location: UK

PostPosted: Fri Jul 22, 2011 6:02 pm    Post subject: Reply with quote

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. Very Happy
_________________
Programmer in: Fortran 77/95/2003/2008, C, C++ (& OpenMP), java, Python, Perl
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
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