- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Unfortunately, I think I have encountered yet another IVF11.1 bug.
It seems that component access to integer and real values via a class pointer gives the wrong result if the class pointer is contained in an array of a type. See the attached code. The first write statement outputs the wrong values.
Interestingly, in this particular case, the debugger does display the correct information, but the code fails. Also, it seem that only integer and real as displayed wrong. Characters work fine, also TYPEs and POINTERS to other objects seem to work fine.
It works ok if using a class pointer directly. The second write give the right results.
The bug appears with IVF 11.1.051, I did not try older releases.
It seems that component access to integer and real values via a class pointer gives the wrong result if the class pointer is contained in an array of a type. See the attached code. The first write statement outputs the wrong values.
Interestingly, in this particular case, the debugger does display the correct information, but the code fails. Also, it seem that only integer and real as displayed wrong. Characters work fine, also TYPEs and POINTERS to other objects seem to work fine.
It works ok if using a class pointer directly. The second write give the right results.
The bug appears with IVF 11.1.051, I did not try older releases.
[plain] program CompAccessBug
implicit none
! Type definitions
TYPE :: BaseType
INTEGER :: i
REAL :: r
CHARACTER :: c
END TYPE
TYPE :: ExtType
INTEGER :: i2
END TYPE
TYPE TypePtr
CLASS (BaseType), POINTER :: Ptr
END TYPE
! Variables
TYPE (BaseType), TARGET :: ExtInst
TYPE (TypePtr) :: PtrInst(1)
class (BaseType), POINTER :: Ptr
! ------
print *, 'Hello World'
ExtInst%i = 1
ExtInst%r = 2.0
ExtInst%c = 'c'
PtrInst(1)%Ptr => ExtInst
WRITE(*,*) PtrInst(1)%Ptr%i, PtrInst(1)%Ptr%r, PtrInst(1)%Ptr%c
Ptr=>PtrInst(1)%Ptr
WRITE(*,*) Ptr%i, Ptr%r, Ptr%c
end program CompAccessBug
[/plain]
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, we'll take a look.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Escalated as issue DPD200141737. This is not a new bug in that it was broken from the original 11.1.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I expect the fix for this to be in Update 5.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It actually got fixed in 11.1 Update 6, available now.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page