[llvm-commits] CVS: llvm/include/llvm/CodeGen/MachineInstr.h

Vikram Adve vadve at cs.uiuc.edu
Tue Jul 1 20:26:01 PDT 2003


Changes in directory llvm/include/llvm/CodeGen:

MachineInstr.h updated: 1.104 -> 1.105

---
Log message:

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


---
Diffs of the changes:

Index: llvm/include/llvm/CodeGen/MachineInstr.h
diff -u llvm/include/llvm/CodeGen/MachineInstr.h:1.104 llvm/include/llvm/CodeGen/MachineInstr.h:1.105
--- llvm/include/llvm/CodeGen/MachineInstr.h:1.104	Sat Jun 21 22:06:13 2003
+++ llvm/include/llvm/CodeGen/MachineInstr.h	Tue Jul  1 20:25:44 2003
@@ -190,6 +190,8 @@
   }
   
   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;





More information about the llvm-commits mailing list