mirror of
https://github.com/zeek/zeek.git
synced 2025-10-05 16:18:19 +00:00
GH-1503: Improve &expire_func compatibility type-checking
Previously, incompatible &expire_funcs could mistakenly be used, such as when using that attribute on the unspecified table()/set() initializations/assignments, resulting in invalid function calls that eventually crash Zeek.
This commit is contained in:
parent
0c93e2fcb8
commit
01f6264c87
6 changed files with 85 additions and 46 deletions
|
@ -391,6 +391,15 @@ class TableType : public IndexType {
|
|||
public:
|
||||
TableType(TypeListPtr ind, TypePtr yield);
|
||||
|
||||
/**
|
||||
* Assesses whether an &expire_func attribute's function type is compatible
|
||||
* with this table type.
|
||||
* @param attr the &expire_func attribute to check (this method must not be
|
||||
* called with other type of attributes).
|
||||
* @return true if compatible, false if not
|
||||
*/
|
||||
bool CheckExpireFuncCompatibility(const detail::AttrPtr& attr);
|
||||
|
||||
TypePtr ShallowClone() override;
|
||||
|
||||
// Returns true if this table type is "unspecified", which is
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue