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:
Robin Sommer 2011-02-02 18:06:02 -08:00
parent e00acaddd8
commit 7abd8f177f
7 changed files with 171 additions and 33 deletions

View file

@ -509,6 +509,9 @@ inline BroType* error_type() { return base_type(TYPE_ERROR); }
// test is done in the context of an initialization.
extern int same_type(const BroType* t1, const BroType* t2, int is_init=0);
// True if the two attribute lists are equivalent.
extern int same_attrs(const Attributes* a1, const Attributes* a2);
// Returns true if the record sub_rec can be promoted to the record
// super_rec.
extern int record_promotion_compatible(const RecordType* super_rec,