CompHash: use class IntrusivePtr for the type field

This commit is contained in:
Max Kellermann 2020-02-18 12:13:33 +01:00
parent 31b3a56740
commit 53f49e0057
7 changed files with 17 additions and 22 deletions

View file

@ -602,10 +602,9 @@ static void int_del_func(void* v)
void SwitchStmt::Init()
{
TypeList* t = new TypeList();
auto t = make_intrusive<TypeList>();
t->Append(e->Type()->Ref());
comp_hash = new CompositeHash(t);
Unref(t);
comp_hash = new CompositeHash(std::move(t));
case_label_value_map.SetDeleteFunc(int_del_func);
}