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

llvm-svn: 7055
This commit is contained in:
Vikram S. Adve 2003-07-02 01:25:44 +00:00
parent 1fce4cfa95
commit 9a8f8e3e95
1 changed files with 2 additions and 0 deletions

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;