aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/CodeGen/MachineInstr.h
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/llvm/CodeGen/MachineInstr.h
parent65b2f401afbaa4a87f0dd4a51cd1f177c7c15e40 (diff)
downloadexternal_llvm-daee2b492fdf706697429f036b37a46ecc84c2fc.zip
external_llvm-daee2b492fdf706697429f036b37a46ecc84c2fc.tar.gz
external_llvm-daee2b492fdf706697429f036b37a46ecc84c2fc.tar.bz2
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/llvm/CodeGen/MachineInstr.h')
-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 721b513..9bc59f3 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;