From: Francisco Jerez Date: Wed, 8 Oct 2014 17:01:26 +0000 (+0300) Subject: clover/util: Fix construction of compat::vector with a general container as argument. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1441a3c1bba542f318cfc0f4468ef34f97121a1d;p=mesa.git clover/util: Fix construction of compat::vector with a general container as argument. --- diff --git a/src/gallium/state_trackers/clover/util/compat.hpp b/src/gallium/state_trackers/clover/util/compat.hpp index 73055775293..ca5b8921a40 100644 --- a/src/gallium/state_trackers/clover/util/compat.hpp +++ b/src/gallium/state_trackers/clover/util/compat.hpp @@ -80,8 +80,10 @@ namespace clover { template vector(const C &v) : - p(alloc(v.size(), &*v.begin(), v.size())), - _size(v.size()) , _capacity(v.size()) { + p(alloc(v.size(), NULL, 0)), _size(0), + _capacity(v.size()) { + for (typename C::const_iterator it = v.begin(); it != v.end(); ++it) + new(&p[_size++]) T(*it); } ~vector() {