From 471756f18169f2800611704adf0d277d545188b8 Mon Sep 17 00:00:00 2001 From: zhenweijin Date: Tue, 20 Jan 2026 11:36:47 +0800 Subject: [PATCH] Fix potential memory leak when discarding FreeMachineFunction Signed-off-by: zhenweijin --- core/iwasm/compilation/aot_orc_extra2.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/core/iwasm/compilation/aot_orc_extra2.cpp b/core/iwasm/compilation/aot_orc_extra2.cpp index 180e540501..6bcfb786b3 100644 --- a/core/iwasm/compilation/aot_orc_extra2.cpp +++ b/core/iwasm/compilation/aot_orc_extra2.cpp @@ -85,6 +85,7 @@ MyPassManager::add(llvm::Pass *P) // a hack to avoid having a copy of the whole addPassesToEmitMC. // we want to add PrintStackSizes before FreeMachineFunctionPass. if (P->getPassName() == "Free MachineFunction") { + delete P; return; } llvm::legacy::PassManager::add(P);