summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2012-04-29 10:53:29 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2012-04-29 10:53:29 +0000
commit3703baacf5c17425a07d57583148086a746c5f98 (patch)
treea4ec787be70b12edb920ed7758a2698b8d609977 /include
parentbbd8e5d79ac4cdc5d205230eac88f69fd309df53 (diff)
downloadllvm-3703baacf5c17425a07d57583148086a746c5f98.tar.gz
llvm-3703baacf5c17425a07d57583148086a746c5f98.tar.bz2
llvm-3703baacf5c17425a07d57583148086a746c5f98.tar.xz
SmallVector: Don't rely on having an assignment operator around in push_back for POD-like types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155791 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/ADT/SmallVector.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/llvm/ADT/SmallVector.h b/include/llvm/ADT/SmallVector.h
index 0d9d0d12e8..8b75ff56a3 100644
--- a/include/llvm/ADT/SmallVector.h
+++ b/include/llvm/ADT/SmallVector.h
@@ -252,7 +252,7 @@ public:
void push_back(const T &Elt) {
if (this->EndX < this->CapacityX) {
Retry:
- *this->end() = Elt;
+ memcpy(this->end(), &Elt, sizeof(T));
this->setEnd(this->end()+1);
return;
}