[Bro-Dev] #363: Sets of records with optional values is broken

Bro Tracker bro at tracker.icir.org
Mon Jan 24 13:43:23 PST 2011

#363: Sets of records with optional values is broken
 Reporter:  seth     |      Owner:
     Type:  Problem  |     Status:  new
 Priority:  Normal   |  Milestone:  Bro1.6
Component:  Bro      |    Version:  git/master
 Keywords:           |
 If you have a record with optional value(s) and the optional value(s)
 aren't assigned to, adding an instance of that record type to a set (or
 probably using it as an index of any kind) fails.

 Example code:


 type FOO: record {
         a: count;
         b: count;
         c: count &optional;

 global foobar: set[FOO] = set();

 event bro_init()
         local bar : FOO = [$a=1, $b=2];
         add foobar[bar];

 Gives this error:

 1295905258.355592 <no location> and ./test.bro, line 7
    ([a=1, b=2, c=<uninitialized>] and list of record { a:count; b:count;
 c:count; }): error, index type doesn't match table

 It seems that the type checking being done by the list code doesn't
 account for the &optional attribute.

Ticket URL: <http://tracker.icir.org/bro/ticket/363>
Bro Tracker <http://tracker.icir.org/bro>
Bro Issue Tracker

More information about the bro-dev mailing list