Type: init_type() returns IntrusivePtr

This commit is contained in:
Max Kellermann 2020-03-03 19:01:54 +01:00
parent cf11d78483
commit f0a357cadf
4 changed files with 10 additions and 10 deletions

View file

@ -64,7 +64,7 @@ static void make_var(ID* id, IntrusivePtr<BroType> t, init_class c,
if ( id->Type() && id->Type()->Tag() != TYPE_ERROR )
{
if ( dt != VAR_REDEF &&
(! init || ! do_init || (! t && ! (t = {AdoptRef{}, init_type(init.get())}))) )
(! init || ! do_init || (! t && ! (t = init_type(init.get())))) )
{
id->Error("already defined", init.get());
return;
@ -103,7 +103,7 @@ static void make_var(ID* id, IntrusivePtr<BroType> t, init_class c,
return;
}
t = {AdoptRef{}, init_type(init.get())};
t = init_type(init.get());
if ( ! t )
{
id->SetType({AdoptRef{}, error_type()});