mirror of
https://github.com/zeek/zeek.git
synced 2025-10-06 08:38:20 +00:00
script optimization fixes for "concretizing" vector-of-any's
This commit is contained in:
parent
fc12ac2b06
commit
bae87fb606
4 changed files with 78 additions and 29 deletions
|
@ -124,6 +124,14 @@ StmtPtr Reducer::GenParam(const IDPtr& id, ExprPtr rhs, bool is_modified) {
|
|||
// the inline block's execution.
|
||||
is_modified = true;
|
||||
|
||||
auto& id_t = id->GetType();
|
||||
if ( id_t->Tag() == TYPE_VECTOR && rhs->GetType()->Yield() != id_t->Yield() )
|
||||
// Presumably either the identifier or the RHS is a vector-of-any.
|
||||
// This means there will essentially be a modification of the RHS
|
||||
// due to the need to use (or omit) operations coercing from such
|
||||
// vectors.
|
||||
is_modified = true;
|
||||
|
||||
if ( ! is_modified ) {
|
||||
// Can use a temporary variable, which then supports
|
||||
// optimization via alias propagation.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue