[Bro-Dev] #485: Error when defining vectors of records with optional fields

Bro Tracker bro at tracker.bro-ids.org
Mon Jun 27 04:10:28 PDT 2011


#485: Error when defining vectors of records with optional fields
----------------------+------------------------
 Reporter:  vallenti  |      Owner:
     Type:  Problem   |     Status:  new
 Priority:  Normal    |  Milestone:  Bro1.6
Component:  Bro       |    Version:  git/master
 Keywords:            |
----------------------+------------------------
 When defining vectors of records that contain optional fields, Bro
 erroneously reports a type clash. Here is a minimal example that triggers
 the bug:
 {{{
 type Foo: record {
     s: string;
     o: string &optional;
 };

 const v: vector of Foo = {
     [$s="bar", $o="check"],
     [$s="baz"]
 }
 }}}

 The error is:
 {{{
 ./vector.bro, line 8 ([$s=bar]): error, type mismatch at index 1
 }}}

 That is, constructing the first records succeeds, but the second falsely
 fails.

-- 
Ticket URL: <http://tracker.bro-ids.org/bro/ticket/485>
Bro Tracker <http://tracker.bro-ids.org/bro>
Bro Issue Tracker



More information about the bro-dev mailing list