mirror of
https://github.com/zeek/zeek.git
synced 2025-10-03 23:28:20 +00:00
fixes for initializations of "-O gen-C++" script compilations
This commit is contained in:
parent
bae87fb606
commit
f7b739a47d
4 changed files with 14 additions and 3 deletions
|
@ -366,6 +366,15 @@ public:
|
|||
protected:
|
||||
IndexType(TypeTag t, TypeListPtr arg_indices, TypePtr arg_yield_type)
|
||||
: Type(t), indices(std::move(arg_indices)), yield_type(std::move(arg_yield_type)) {
|
||||
// "indices" might be nil if we're deferring construction of the type
|
||||
// for "-O use-C++" initialization.
|
||||
if ( indices )
|
||||
SetSpecialIndices();
|
||||
else
|
||||
is_subnet_index = is_pattern_index = false; // placeholders
|
||||
}
|
||||
|
||||
void SetSpecialIndices() {
|
||||
const auto& types = indices->GetTypes();
|
||||
is_subnet_index = types.size() == 1 && types[0]->Tag() == TYPE_SUBNET;
|
||||
is_pattern_index = types.size() == 1 && types[0]->Tag() == TYPE_PATTERN;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue