From a36c06e5cd861786d2a463c951246800b4268af9 Mon Sep 17 00:00:00 2001 From: Vern Paxson Date: Fri, 1 Sep 2023 12:20:46 -0700 Subject: [PATCH] fix for ZAM statement-level profiling (broken by GH-3199) --- src/script_opt/ScriptOpt.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/script_opt/ScriptOpt.cc b/src/script_opt/ScriptOpt.cc index 1b085a9dc2..514cc671f7 100644 --- a/src/script_opt/ScriptOpt.cc +++ b/src/script_opt/ScriptOpt.cc @@ -554,6 +554,9 @@ void clear_script_analysis() { IDOptInfo::ClearGlobalInitExprs(); + // Keep the functions around if we're debugging, so we can + // generate profiles. +#ifndef DEBUG // We need to explicitly clear out the optimization information // associated with identifiers. They have reference loops with // the parent identifier that will prevent reclamation of the @@ -564,6 +567,8 @@ void clear_script_analysis() id->ClearOptInfo(); funcs.clear(); +#endif + non_recursive_funcs.clear(); lambdas.clear(); when_lambdas.clear();