mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-18 18:42:46 +02:00
Plug a leak introduced by r240848
Apparently this obvious leak was never exercised before, but r240848 exposed it. Plug it. http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/5075 llvm-svn: 240865
This commit is contained in:
parent
ca28a083c8
commit
6242c6f724
@ -1941,8 +1941,11 @@ static void WriteAsOperandInternal(raw_ostream &Out, const Metadata *MD,
|
||||
SlotTracker *Machine, const Module *Context,
|
||||
bool FromValue) {
|
||||
if (const MDNode *N = dyn_cast<MDNode>(MD)) {
|
||||
if (!Machine)
|
||||
Machine = new SlotTracker(Context);
|
||||
std::unique_ptr<SlotTracker> MachineStorage;
|
||||
if (!Machine) {
|
||||
MachineStorage = make_unique<SlotTracker>(Context);
|
||||
Machine = MachineStorage.get();
|
||||
}
|
||||
int Slot = Machine->getMetadataSlot(N);
|
||||
if (Slot == -1)
|
||||
// Give the pointer value instead of "badref", since this comes up all
|
||||
|
Loading…
Reference in New Issue
Block a user