Skip to content
Commit 3657e777 authored by Wang, Xin10's avatar Wang, Xin10
Browse files

Add delete to fix resource leak in llc.cpp

From line 693 in file llc.cpp, it uses new operator to creates a ModulePass
and assigned to MMIWP. If the condition after take the true branch, it has
chance to go in to line 702 or line 709, the function will return without
cleaning the memory.
The second issue existed for the same reason, the ref TPC get the pointer
created from LLVMTM.createPassConfig, and will leak memory if goes into
line 709.
This patch uses delete in the issued branch.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D147993
parent 07fef178
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment