Field initialize m_hash

valgrind complain (rightly) about use of uninitialized
if Structure ctor throws (eg. duplicate field).
~Field will then try to use m_hash before it has been
initialized.  This don't hurt and the subsequent equality
tests prevent any bad behavior.
This commit is contained in:
Michael Davidsaver
2018-07-30 14:50:03 -07:00
parent c67fdafb43
commit c8b615b3ee

View File

@@ -79,6 +79,7 @@ struct FieldCreate::Helper {
Field::Field(Type type)
: m_fieldType(type)
, m_hash(0)
{
REFTRACE_INCREMENT(num_instances);
}