From e133e7d85268d9a4c76ec69954f86f602a9724bb Mon Sep 17 00:00:00 2001 From: "Vikram S. Adve" Date: Wed, 2 Jul 2003 01:25:44 +0000 Subject: [PATCH] Leak fix: delete old objects before reallocation in an assignment operator! llvm-svn: 7055 --- include/llvm/CodeGen/MachineInstr.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/llvm/CodeGen/MachineInstr.h b/include/llvm/CodeGen/MachineInstr.h index 721b513c747..9bc59f3ff41 100644 --- a/include/llvm/CodeGen/MachineInstr.h +++ b/include/llvm/CodeGen/MachineInstr.h @@ -190,6 +190,8 @@ public: } const MachineOperand &operator=(const MachineOperand &MO) { + if (isExternalSymbol()) // if old operand had a symbol name, + delete SymbolName; // release old memory immedVal = MO.immedVal; flags = MO.flags; opType = MO.opType;