mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-26 23:24:34 +00:00
Call the destructors of the MCSections.
They now contain the fragments. If we don't call the destructors the fragments leak. Found by an asan bot. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238161 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -10,6 +10,7 @@
|
|||||||
#include "llvm/MC/MCContext.h"
|
#include "llvm/MC/MCContext.h"
|
||||||
#include "llvm/ADT/SmallString.h"
|
#include "llvm/ADT/SmallString.h"
|
||||||
#include "llvm/ADT/Twine.h"
|
#include "llvm/ADT/Twine.h"
|
||||||
|
#include "llvm/MC/MCAssembler.h"
|
||||||
#include "llvm/MC/MCAsmInfo.h"
|
#include "llvm/MC/MCAsmInfo.h"
|
||||||
#include "llvm/MC/MCDwarf.h"
|
#include "llvm/MC/MCDwarf.h"
|
||||||
#include "llvm/MC/MCLabel.h"
|
#include "llvm/MC/MCLabel.h"
|
||||||
@ -54,6 +55,13 @@ MCContext::MCContext(const MCAsmInfo *mai, const MCRegisterInfo *mri,
|
|||||||
}
|
}
|
||||||
|
|
||||||
MCContext::~MCContext() {
|
MCContext::~MCContext() {
|
||||||
|
// Call the destructors so the fragments are freed
|
||||||
|
for (auto &I : ELFUniquingMap)
|
||||||
|
I.second->~MCSectionELF();
|
||||||
|
for (auto &I : COFFUniquingMap)
|
||||||
|
I.second->~MCSectionCOFF();
|
||||||
|
for (auto &I : MachOUniquingMap)
|
||||||
|
I.second->~MCSectionMachO();
|
||||||
|
|
||||||
if (AutoReset)
|
if (AutoReset)
|
||||||
reset();
|
reset();
|
||||||
|
Reference in New Issue
Block a user