Skip to content

Commit 0cf9d45

Browse files
kylo5abycasaroli
authored andcommitted
Fix potential memory leak when discarding FreeMachineFunction (bytecodealliance#4796)
Signed-off-by: zhenweijin <zhenwei.jin@intel.com>
1 parent 57dce3c commit 0cf9d45

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

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)