Skip to content

Commit

Permalink
Fix UBSan issue
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitri Mokhov <[email protected]>
  • Loading branch information
dnmokhov committed Jan 25, 2025
1 parent 9d45787 commit d9e9d58
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions include/oneapi/tbb/concurrent_hash_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -467,9 +467,11 @@ class hash_map_iterator {
friend class concurrent_hash_map;

hash_map_iterator( const Container &map, std::size_t index, const bucket *b, node_base *n ) :
my_map(&map), my_index(index), my_bucket(b), my_node(static_cast<node*>(n))
my_map(&map), my_index(index), my_bucket(b), my_node(nullptr)
{
if( b && !map_base::is_valid(n) )
if( map_base::is_valid(n) )
my_node = static_cast<node*>(n);
else if( b )
advance_to_next_bucket();
}

Expand Down

0 comments on commit d9e9d58

Please sign in to comment.