diff options
| author | Vikram S. Adve <vadve@cs.uiuc.edu> | 2003-07-02 01:25:44 +0000 |
|---|---|---|
| committer | Vikram S. Adve <vadve@cs.uiuc.edu> | 2003-07-02 01:25:44 +0000 |
| commit | daee2b492fdf706697429f036b37a46ecc84c2fc (patch) | |
| tree | a42f0cefead2d3186616df11a37d0a35ab4aeb38 /include | |
| parent | 65b2f401afbaa4a87f0dd4a51cd1f177c7c15e40 (diff) | |
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
Diffstat (limited to 'include')
| -rw-r--r-- | include/llvm/CodeGen/MachineInstr.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/MachineInstr.h b/include/llvm/CodeGen/MachineInstr.h index 721b513c74..9bc59f3ff4 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; |
