[Bro-Dev] #981: &default record only creates one record

Bro Tracker bro at tracker.bro.org
Thu Apr 18 16:47:58 PDT 2013


#981: &default record only creates one record
------------------------+---------------------
 Reporter:  dmandelb    |       Type:  Problem
   Status:  new         |   Priority:  Low
Milestone:  Bro2.2      |  Component:  Bro
  Version:  git/master  |   Keywords:
------------------------+---------------------
 It seems like when a table's &default is set to a record (either as
 returned by copy() or a literal []-expression), only one copy is created
 instead of one copy per table entry.

 This code

 {{{
 type Foo: record {
         x: count &default=0;
 };

 global foo: table[count] of Foo = {} &default=[];

 print(foo[0]$x);
 print(foo[1]$x);
 foo[0]$x = 0;
 foo[1]$x = 1;
 print(foo[0]$x);
 print(foo[1]$x);
 }}}

 prints

 {{{
 0
 0
 1
 1
 }}}

 but I think it should print

 {{{
 0
 0
 0
 1
 }}}

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



More information about the bro-dev mailing list