mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-14 23:00:44 +02:00
Fixes a memory leak in IRValidation
This commit is contained in:
1 parent
a1ac4c711c
commit
8d2eebd644
1 file changed
+12
-2
@@ -19,9 +19,18 @@ namespace FEXCore::IR::Validation {
|
||||
|
||||
class IRValidation final : public FEXCore::IR::Pass {
|
||||
public:
|
||||
~IRValidation();
|
||||
bool Run(IREmitter *IREmit) override;
|
||||
|
||||
private:
|
||||
BitSet<uint64_t> NodeIsLive;
|
||||
size_t MaxNodes{};
|
||||
};
|
||||
|
||||
IRValidation::~IRValidation() {
|
||||
NodeIsLive.Free();
|
||||
}
|
||||
|
||||
bool IRValidation::Run(IREmitter *IREmit) {
|
||||
bool HadError = false;
|
||||
bool HadWarning = false;
|
||||
@@ -32,8 +41,9 @@ bool IRValidation::Run(IREmitter *IREmit) {
|
||||
std::ostringstream Errors;
|
||||
std::ostringstream Warnings;
|
||||
|
||||
BitSet<uint64_t> NodeIsLive;
|
||||
NodeIsLive.Allocate(CurrentIR.GetSSACount());
|
||||
if (CurrentIR.GetSSACount() > MaxNodes) {
|
||||
NodeIsLive.Realloc(CurrentIR.GetSSACount());
|
||||
}
|
||||
|
||||
std::vector<uint32_t> Uses(CurrentIR.GetSSACount(), 0);
|
||||
|
||||
|
||||
Reference in new issue
Block a user