Skip to content

Commit 56d9b9e

Browse files
committed
Set_other CI fix
Hopefully this fixes the CI failures seen on 32 bit Gfortran.
1 parent 482776d commit 56d9b9e

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

src/stdlib_hashmap_chaining.f90

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -809,16 +809,14 @@ module subroutine set_other_chaining_data( map, key, other, exists )
809809
invalid_inmap
810810
end if
811811
else if ( associated( map % inverse(inmap) % target ) ) then
812-
! associate( target => map % inverse(inmap) % target )
813-
! target % other = other
814-
!map % inverse(inmap) % target % other = other
812+
! Explicit deallocation and allocation used to avoid issue
813+
! seen with 32 bit version of Gfortran.
815814
if ( allocated( map % inverse(inmap) % target % other ) ) then
816815
deallocate( map % inverse(inmap) % target % other )
817816
endif
818817
allocate( map % inverse(inmap) % target % other, source=other)
819818
if ( present(exists) ) exists = .true.
820819
return
821-
! end associate
822820
else
823821
error stop submodule_name // ' % ' // procedure // ': ' // &
824822
invalid_inmap

src/stdlib_hashmap_open.f90

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -839,11 +839,14 @@ module subroutine set_other_open_data( map, key, other, exists )
839839
invalid_inmap
840840
end if
841841
else if ( associated( map % inverse(inmap) % target ) ) then
842-
associate( target => map % inverse(inmap) % target )
843-
target % other = other
844-
if ( present(exists) ) exists = .true.
845-
return
846-
end associate
842+
! Explicit deallocation and allocation used to avoid issue
843+
! seen with 32 bit version of Gfortran.
844+
if ( allocated( map % inverse(inmap) % target % other ) ) then
845+
deallocate( map % inverse(inmap) % target % other )
846+
endif
847+
allocate( map % inverse(inmap) % target % other, source=other)
848+
if ( present(exists) ) exists = .true.
849+
return
847850
else
848851
error stop submodule_name // ' % ' // procedure // ': ' // &
849852
invalid_inmap

0 commit comments

Comments
 (0)