mirror of
https://github.com/zeek/zeek.git
synced 2025-10-03 15:18:20 +00:00
fixes for the fact that Spicy event handlers start off with a null type
This commit is contained in:
parent
bd7784b848
commit
08ead8952e
1 changed files with 9 additions and 0 deletions
|
@ -110,6 +110,12 @@ void activate_bodies__CPP(const char* fn, const char* module, bool exported, Typ
|
||||||
fg->SetType(ft);
|
fg->SetType(ft);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( ! fg->GetType() )
|
||||||
|
// This can happen both because we just installed the ID, but also
|
||||||
|
// because events registered by Spicy don't have types associated
|
||||||
|
// with them initially.
|
||||||
|
fg->SetType(ft);
|
||||||
|
|
||||||
if ( ! fg->GetAttr(ATTR_IS_USED) )
|
if ( ! fg->GetAttr(ATTR_IS_USED) )
|
||||||
fg->AddAttr(make_intrusive<Attr>(ATTR_IS_USED));
|
fg->AddAttr(make_intrusive<Attr>(ATTR_IS_USED));
|
||||||
|
|
||||||
|
@ -175,6 +181,9 @@ IDPtr lookup_global__CPP(const char* g, const TypePtr& t, const GlobalCharacteri
|
||||||
gl->MakeType();
|
gl->MakeType();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else if ( ! gl->GetType() )
|
||||||
|
gl->SetType(t);
|
||||||
|
|
||||||
return gl;
|
return gl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue