From 61df1d1804846aa096860deaed6d0e9750e328a3 Mon Sep 17 00:00:00 2001 From: Zhihao Yuan Date: Thu, 8 Aug 2019 16:43:36 -0500 Subject: [PATCH] Avoid returning uninitialized allocator --- thrust/detail/allocator/allocator_traits.inl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/thrust/detail/allocator/allocator_traits.inl b/thrust/detail/allocator/allocator_traits.inl index 1b3da43d90..5f8df30b05 100644 --- a/thrust/detail/allocator/allocator_traits.inl +++ b/thrust/detail/allocator/allocator_traits.inl @@ -245,9 +245,8 @@ __host__ __device__ >::type system(Alloc &) { - // return a copy of a default-constructed system - typename allocator_system::type result; - return result; + // return a copy of a value-initialized system + return typename allocator_system::type(); }