>  private:
>    void CopyFrom(const DenseMap& other) {
> -    if (NumEntries != 0) {
> +    if (NumBuckets != 0 && !KeyInfoT::isPod()) {
...
> +    if (KeyInfoT::isPod())

Shouldn't this require that the key and value both be pod?

> +      memcpy(Buckets, other.Buckets, other.NumBuckets * sizeof 
> (BucketT));
> +    else
> +      for (size_t i = 0; i < other.NumBuckets; ++i) {
> +        new (Buckets[i].first) KeyT(other.Buckets[i].first);
> +        new (Buckets[i].second) ValueT(other.Buckets[i].second);

This should not construct keys/values for buckets that are not valid.

-Chris



_______________________________________________
llvm-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to