From 68e1307ab3b5fb860e878b9780b30cb4646cbc1e Mon Sep 17 00:00:00 2001 From: Vern Paxson Date: Sat, 28 Dec 2024 13:50:58 -0800 Subject: [PATCH] fix for globals that use other globals in their inits --- src/script_opt/CPP/Driver.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/script_opt/CPP/Driver.cc b/src/script_opt/CPP/Driver.cc index 45c0ffb7ac..3cf63d365b 100644 --- a/src/script_opt/CPP/Driver.cc +++ b/src/script_opt/CPP/Driver.cc @@ -63,6 +63,10 @@ void CPPCompile::Compile(bool report_uncompilable) { (void)pfs->HashType(t); rep_types.insert(TypeRep(t)); } + for ( auto& g : pf->Globals() ) + accessed_globals.insert(g); + for ( auto& ag : pf->AllGlobals() ) + all_accessed_globals.insert(ag); } }