[Bro-Dev] #367: internal_error with &optional fields in records used as indexes
Bro Tracker
bro at tracker.icir.org
Tue Feb 8 13:29:30 PST 2011
#367: internal_error with &optional fields in records used as indexes
----------------------+------------------------
Reporter: seth | Owner:
Type: Problem | Status: new
Priority: Normal | Milestone: Bro1.6
Component: Bro | Version: git/master
Resolution: | Keywords: logging
----------------------+------------------------
Comment (by seth):
Thanks for the fix. I found more problems though. If there is an "any"
type in the record it fails in every way possible. :)
Example with an optional "any" field. Not attempting to fill it in at
assignment:
{{{
type FOO: record {
a: string;
b: any &optional;
};
global table_test: table[string] of set[FOO];
event bro_init()
{
table_test["one"] = set();
add table_test["one"][[$a="test"]];
}
}}}
Results in:
{{{
[seth at Blake build (topic/logging-framework)]$ ./src/bro test-367.bro
1297200320.323972 internal error: bad index type in
CompositeHash::CompositeHash
Abort trap
}}}
Example with a non-optional any field, filling it in with a string on
assignment:
{{{
type FOO: record {
a: string;
b: any;
};
global table_test: table[string] of set[FOO];
event bro_init()
{
table_test["one"] = set();
add table_test["one"][[$a="test", $b="asdf"]];
}
}}}
Results in:
{{{
[seth at Blake build (topic/logging-framework)]$ ./src/bro test-367.bro
1297200425.455970 <no location> and ./test-367.bro, line 6
([a=test, b=asdf] and list of record { a:string; b:any; }): error,
index type doesn't match table
}}}
--
Ticket URL: <http://tracker.icir.org/bro/ticket/367#comment:6>
Bro Tracker <http://tracker.icir.org/bro>
Bro Issue Tracker
More information about the bro-dev
mailing list