Skip to content
This repository was archived by the owner on Mar 21, 2024. It is now read-only.

Commit

Permalink
Avoid returning uninitialized allocator
Browse files Browse the repository at this point in the history
  • Loading branch information
zhihaoy authored and alliepiper committed Jun 9, 2020
1 parent d26be73 commit b9a2073
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions thrust/detail/allocator/allocator_traits.inl
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,8 @@ __host__ __device__
>::type
system(Alloc &)
{
// return a copy of a default-constructed system
typename allocator_system<Alloc>::type result;
return result;
// return a copy of a value-initialized system
return typename allocator_system<Alloc>::type();
}


Expand Down

0 comments on commit b9a2073

Please sign in to comment.