[Bro-Dev] #722: &default vector initialization

Bro Tracker bro at tracker.bro-ids.org
Tue Dec 13 13:43:03 PST 2011


#722: &default vector initialization
---------------------+------------------------
 Reporter:  jsiwek   |      Owner:
     Type:  Problem  |     Status:  new
 Priority:  Normal   |  Milestone:
Component:  Bro      |    Version:  git/master
 Keywords:           |
---------------------+------------------------
 This code:

 {{{
 type MyRecord: record {
     c: count;
     v: vector of string &default=vector();
 };

 event bro_init()
     {
     local r: MyRecord = [$c=13];
     print r;
     print |r$v|;
     r$v[|r$v|] = "test";
     print r;
     print |r$v|;
 }}}

 Gives unexpected resulting output:

 {{{
 [c=13, v=<uninitialized>]
 0
 [c=13, v=<uninitialized>]
 0
 }}}

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



More information about the bro-dev mailing list