This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] warn on mem calls modifying objects of non-trivial types (PR 80560)


Hello,
> diff --git a/gcc/hash-table.h b/gcc/hash-table.h
> index 0f7e21a..443d16c 100644
> --- a/gcc/hash-table.h
> +++ b/gcc/hash-table.h
> @@ -803,7 +803,10 @@ hash_table<Descriptor, Allocator>::empty_slow ()
>        m_size_prime_index = nindex;
>      }
>    else
> -    memset (entries, 0, size * sizeof (value_type));
> +    {
> +      for ( ; size; ++entries, --size)
> +	*entries = value_type ();
> +    }
>    m_n_deleted = 0;
>    m_n_elements = 0;
>  }

This change sends our periodic testers into an infinite loop.  It is fault of gcc 4.2 being used
as bootstrap compiler, but perhaps that can be worked around?

Honza


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]