From 227462e4d8a29fee2d602d83fa70c3801bed6178 Mon Sep 17 00:00:00 2001 From: wannacu Date: Thu, 7 Jul 2022 14:39:00 +0800 Subject: [PATCH] AOTIR: Fix IRList delete --- External/FEXCore/Source/Interface/IR/AOTIR.cpp | 2 +- External/FEXCore/include/FEXCore/IR/IntrusiveIRList.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/External/FEXCore/Source/Interface/IR/AOTIR.cpp b/External/FEXCore/Source/Interface/IR/AOTIR.cpp index d400cc59b..48b6ed16d 100644 --- a/External/FEXCore/Source/Interface/IR/AOTIR.cpp +++ b/External/FEXCore/Source/Interface/IR/AOTIR.cpp @@ -360,7 +360,7 @@ namespace FEXCore::IR { else { // If the IR doesn't need to be retained then we can just delete it now delete DebugData; - delete IRList; + if (IRList->IsCopy()) delete IRList; } } } diff --git a/External/FEXCore/include/FEXCore/IR/IntrusiveIRList.h b/External/FEXCore/include/FEXCore/IR/IntrusiveIRList.h index 0cc6b4647..99708e188 100644 --- a/External/FEXCore/include/FEXCore/IR/IntrusiveIRList.h +++ b/External/FEXCore/include/FEXCore/IR/IntrusiveIRList.h @@ -181,7 +181,7 @@ public: //size_t ListSize; stream.write((const char*)&ListSize, sizeof(ListSize)); //uint64_t Flags; - uint64_t WrittenFlags = Flags | FLAG_Shared; //on disk format always has the Shared flag + uint64_t WrittenFlags = FLAG_Shared; //on disk format always has the Shared flag stream.write((const char*)&WrittenFlags, sizeof(WrittenFlags)); // inline data @@ -200,7 +200,7 @@ public: //size_t ListSize; memcpy(ptr, &ListSize, sizeof(ListSize)); ptr += sizeof(ListSize); //uint64_t Flags; - uint64_t WrittenFlags = Flags | FLAG_Shared; //on disk format always has the Shared flag + uint64_t WrittenFlags = FLAG_Shared; //on disk format always has the Shared flag memcpy(ptr, &WrittenFlags, sizeof(WrittenFlags)); ptr += sizeof(WrittenFlags); // inline data