mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-27 04:18:42 +00:00
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:
1 parent
65b2f401af
commit
daee2b492f
1 file changed
+2
@@ -190,6 +190,8 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
const MachineOperand &operator=(const MachineOperand &MO) {
|
const MachineOperand &operator=(const MachineOperand &MO) {
|
||||||
|
if (isExternalSymbol()) // if old operand had a symbol name,
|
||||||
|
delete SymbolName; // release old memory
|
||||||
immedVal = MO.immedVal;
|
immedVal = MO.immedVal;
|
||||||
flags = MO.flags;
|
flags = MO.flags;
|
||||||
opType = MO.opType;
|
opType = MO.opType;
|
||||||
|
|||||||
Reference in new issue
Block a user