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:
@@ -79,6 +79,7 @@ struct FieldCreate::Helper {
|
||||
|
||||
Field::Field(Type type)
|
||||
: m_fieldType(type)
|
||||
, m_hash(0)
|
||||
{
|
||||
REFTRACE_INCREMENT(num_instances);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user