summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorVikram S. Adve <vadve@cs.uiuc.edu>2003-07-02 01:25:44 +0000
committerVikram S. Adve <vadve@cs.uiuc.edu>2003-07-02 01:25:44 +0000
commitdaee2b492fdf706697429f036b37a46ecc84c2fc (patch)
treea42f0cefead2d3186616df11a37d0a35ab4aeb38 /include
parent65b2f401afbaa4a87f0dd4a51cd1f177c7c15e40 (diff)
downloadllvm-daee2b492fdf706697429f036b37a46ecc84c2fc.tar.gz
llvm-daee2b492fdf706697429f036b37a46ecc84c2fc.tar.bz2
llvm-daee2b492fdf706697429f036b37a46ecc84c2fc.tar.xz
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.h2
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;