Leak fix: delete old objects before reallocation in an assignment operator!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7055 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Vikram S. Adve 2003-07-02 01:25:44 +00:00
parent 65b2f401af
commit daee2b492f

View File

@ -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;