From 22af54dda2088f95ddbffd31dcbf9b5123f8f537 Mon Sep 17 00:00:00 2001 From: Vern Paxson Date: Sun, 30 May 2021 17:36:41 -0700 Subject: [PATCH] fix for analyzing variable usage inside of table initializers --- src/script_opt/GenRDs.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/script_opt/GenRDs.cc b/src/script_opt/GenRDs.cc index 7ced9b3180..e42d21856d 100644 --- a/src/script_opt/GenRDs.cc +++ b/src/script_opt/GenRDs.cc @@ -812,6 +812,17 @@ TraversalCode RD_Decorate::PreExpr(const Expr* e) auto lhs = a->Op1(); auto rhs = a->Op2(); + if ( lhs->Tag() == EXPR_LIST && + rhs->GetType()->Tag() != TYPE_ANY ) + { + // This combination occurs only for assignments used + // to initialize table entries. Treat it as references + // to both the lhs and the rhs, not as an assignment. + mgr.SetPreFromPre(a->GetOp1().get(), a); + mgr.SetPreFromPre(a->GetOp2().get(), a); + return TC_CONTINUE; + } + bool rhs_aggr = IsAggr(rhs); mgr.SetPreFromPre(lhs, a);