mirror of
https://github.com/zeek/zeek.git
synced 2025-10-13 12:08:20 +00:00
Fixing a problem with records having optional fields when used as
table/set indices. This addresses #367. In principle, the fix is quite straightford. However, it turns out that sometimes record fields lost their attributes on assignment, and then the hashing can't decide anymore whether a field is optional or not. So that needed to be fixed as well.
This commit is contained in:
parent
e00acaddd8
commit
7abd8f177f
7 changed files with 171 additions and 33 deletions
11
src/Type.cc
11
src/Type.cc
|
@ -1430,6 +1430,17 @@ int same_type(const BroType* t1, const BroType* t2, int is_init)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int same_attrs(const Attributes* a1, const Attributes* a2)
|
||||
{
|
||||
if ( ! a1 )
|
||||
return (a2 != 0);
|
||||
|
||||
if ( ! a2 )
|
||||
return 0;
|
||||
|
||||
return (*a1 == *a2);
|
||||
}
|
||||
|
||||
int record_promotion_compatible(const RecordType* /* super_rec */,
|
||||
const RecordType* /* sub_rec */)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue