mirror of
https://github.com/zeek/zeek.git
synced 2025-10-03 07:08:19 +00:00

In some cases one can get the Type() of unaryexpr to be ANY. Vectors so far did not deal gracefully with this and crashed because trying to convert any to a vectortype. This patch fixes this by just using the original vector-type in this case.
19 lines
396 B
Text
19 lines
396 B
Text
# @TEST-EXEC: bro %INPUT
|
|
|
|
# This regression test checks a special case in the vector code. In this case
|
|
# UnaryExpr will be called with a Type() of any. Tests succeeds if it does not
|
|
# crash Bro.
|
|
|
|
type OptionCacheValue: record {
|
|
val: any;
|
|
};
|
|
|
|
function set_me(val: any) {
|
|
local a = OptionCacheValue($val=val);
|
|
print a;
|
|
}
|
|
|
|
event bro_init() {
|
|
local b: vector of count = {1, 2, 3};
|
|
set_me(b);
|
|
}
|