diff options
author | Duncan Sands <baldrick@free.fr> | 2011-03-07 19:38:38 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2011-03-07 19:38:38 +0000 |
commit | e54f64899fbaaa95fc3241236aabfaa37003a658 (patch) | |
tree | 445e178010b5ba5e7dcfc753c2b7eb27799ed4e7 /include | |
parent | 42daf912e0d138c1faaeaab9d04e7bbfed633e57 (diff) | |
download | external_llvm-e54f64899fbaaa95fc3241236aabfaa37003a658.zip external_llvm-e54f64899fbaaa95fc3241236aabfaa37003a658.tar.gz external_llvm-e54f64899fbaaa95fc3241236aabfaa37003a658.tar.bz2 |
Often GCC can see that NumBuckets is zero here, resulting in a warning
about possibly swapped memset parameters. Avoid the warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127170 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/ADT/DenseMap.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/llvm/ADT/DenseMap.h b/include/llvm/ADT/DenseMap.h index dd341c6..9d2b11d 100644 --- a/include/llvm/ADT/DenseMap.h +++ b/include/llvm/ADT/DenseMap.h @@ -72,7 +72,8 @@ public: P->first.~KeyT(); } #ifndef NDEBUG - memset(Buckets, 0x5a, sizeof(BucketT)*NumBuckets); + if (NumBuckets) + memset(Buckets, 0x5a, sizeof(BucketT)*NumBuckets); #endif operator delete(Buckets); } |