Skip to content

Commit 0a6f2be

Browse files
committed
ensure namespace has hash (flang 20 bug)
1 parent c8f0b9b commit 0a6f2be

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/operation/namespace.f90

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ subroutine namespace_move_value_in(namespace, key, value, err)
4949

5050
print *, "pushing key <", key, ">"
5151

52+
if (.not. associated(namespace%vars%hasher)) then
53+
namespace%vars%hasher => fnv_hash
54+
end if
55+
5256
node => get_node(namespace%vars, key)
5357
if (.not. associated(node)) error stop
5458

@@ -64,6 +68,10 @@ subroutine namespace_fetch_value(namespace, key, value, err)
6468
class(value_t), allocatable, intent(inout) :: value
6569
type(err_t), intent(out), optional :: err
6670

71+
if (.not. associated(namespace%vars%hasher)) then
72+
namespace%vars%hasher => fnv_hash
73+
end if
74+
6775
select type (item => get(namespace%vars, key))
6876
type is (value_item_t)
6977
value = item % value
@@ -86,6 +94,10 @@ subroutine namespace_fetch_ptr(namespace, key, ptr, err)
8694
type(err_t), intent(out), optional :: err
8795
!! Optional error object
8896

97+
if (.not. associated(namespace%vars%hasher)) then
98+
namespace%vars%hasher => fnv_hash
99+
end if
100+
89101
select type (item_ptr => get_ptr(namespace%vars, key))
90102
type is (value_item_t)
91103
ptr => item_ptr % value

0 commit comments

Comments
 (0)