diff --git a/src/script_opt/CPP/Attrs.cc b/src/script_opt/CPP/Attrs.cc index 437270a7d4..c4ba3345b6 100644 --- a/src/script_opt/CPP/Attrs.cc +++ b/src/script_opt/CPP/Attrs.cc @@ -18,7 +18,7 @@ shared_ptr CPPCompile::RegisterAttributes(const AttributesPtr& att if ( pa != processed_attrs.end() ) return pa->second; - attributes.AddKey(attrs); + attributes.AddKey(attrs, pfs.HashAttrs(attrs)); // The cast is just so we can make an IntrusivePtr. auto a_rep = const_cast(attributes.GetRep(attrs)); @@ -49,7 +49,7 @@ shared_ptr CPPCompile::RegisterAttr(const AttrPtr& attr) const auto& e = a->GetExpr(); if ( e && ! IsSimpleInitExpr(e) ) - init_exprs.AddKey(e); + init_exprs.AddKey(e, p_hash(e)); auto gi = make_shared(this, attr); attr_info->AddInstance(gi); diff --git a/src/script_opt/CPP/InitsInfo.cc b/src/script_opt/CPP/InitsInfo.cc index ba423e10fc..17fd7372d1 100644 --- a/src/script_opt/CPP/InitsInfo.cc +++ b/src/script_opt/CPP/InitsInfo.cc @@ -439,6 +439,9 @@ ListTypeInfo::ListTypeInfo(CPPCompile* _c, TypePtr _t) if ( gi ) init_cohort = max(init_cohort, gi->InitCohort()); } + + if ( ! types.empty() ) + ++init_cohort; } void ListTypeInfo::AddInitializerVals(std::vector& ivs) const diff --git a/src/script_opt/ProfileFunc.cc b/src/script_opt/ProfileFunc.cc index a6057eb4e3..74f2ab28c8 100644 --- a/src/script_opt/ProfileFunc.cc +++ b/src/script_opt/ProfileFunc.cc @@ -917,7 +917,10 @@ p_hash_type ProfileFuncs::HashAttrs(const AttributesPtr& Attrs) // can vary in structure due to compilation of elements. We // do though enforce consistency for their types. if ( e ) + { h = merge_p_hashes(h, HashType(e->GetType())); + h = merge_p_hashes(h, p_hash(e.get())); + } } return h;