Skip to content

Commit 9a23968

Browse files
authored
Fix potential memory leak when discarding FreeMachineFunction (#4796)
Signed-off-by: zhenweijin <zhenwei.jin@intel.com>
1 parent b237870 commit 9a23968

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

core/iwasm/compilation/aot_orc_extra2.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ MyPassManager::add(llvm::Pass *P)
8585
// a hack to avoid having a copy of the whole addPassesToEmitMC.
8686
// we want to add PrintStackSizes before FreeMachineFunctionPass.
8787
if (P->getPassName() == "Free MachineFunction") {
88+
delete P;
8889
return;
8990
}
9091
llvm::legacy::PassManager::add(P);

0 commit comments

Comments
 (0)