Skip to content
This repository has been 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 committed Oct 28, 2019
1 parent 20e1c43 commit 61df1d1
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 @@ -245,9 +245,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 61df1d1

Please sign in to comment.