[llvm-commits] [llvm] r127170 - /llvm/trunk/include/llvm/ADT/DenseMap.h
Duncan Sands
baldrick at free.fr
Mon Mar 7 11:38:39 PST 2011
Author: baldrick
Date: Mon Mar 7 13:38:38 2011
New Revision: 127170
URL: http://llvm.org/viewvc/llvm-project?rev=127170&view=rev
Log:
Often GCC can see that NumBuckets is zero here, resulting in a warning
about possibly swapped memset parameters. Avoid the warning.
Modified:
llvm/trunk/include/llvm/ADT/DenseMap.h
Modified: llvm/trunk/include/llvm/ADT/DenseMap.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/DenseMap.h?rev=127170&r1=127169&r2=127170&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/DenseMap.h (original)
+++ llvm/trunk/include/llvm/ADT/DenseMap.h Mon Mar 7 13:38:38 2011
@@ -72,7 +72,8 @@
P->first.~KeyT();
}
#ifndef NDEBUG
- memset(Buckets, 0x5a, sizeof(BucketT)*NumBuckets);
+ if (NumBuckets)
+ memset(Buckets, 0x5a, sizeof(BucketT)*NumBuckets);
#endif
operator delete(Buckets);
}
More information about the llvm-commits
mailing list