[llvm-commits] CVS: llvm/lib/VMCore/Type.cpp

Reid Spencer reid at x10sys.com
Mon Apr 9 10:20:35 PDT 2007



Changes in directory llvm/lib/VMCore:

Type.cpp updated: 1.180 -> 1.181
---
Log message:

Remove a memory leak, until ParamAttrsList is uniqued.


---
Diffs of the changes:  (+5 -1)

 Type.cpp |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletion(-)


Index: llvm/lib/VMCore/Type.cpp
diff -u llvm/lib/VMCore/Type.cpp:1.180 llvm/lib/VMCore/Type.cpp:1.181
--- llvm/lib/VMCore/Type.cpp:1.180	Mon Apr  9 10:01:12 2007
+++ llvm/lib/VMCore/Type.cpp	Mon Apr  9 12:20:18 2007
@@ -1098,7 +1098,11 @@
 
   FunctionValType VT(ReturnType, Params, isVarArg, Attrs);
   FunctionType *MT = FunctionTypes->get(VT);
-  if (MT) return MT;
+  if (MT) { 
+    delete Attrs; // not needed any more
+    return MT;
+  }
+
 
   MT = (FunctionType*) new char[sizeof(FunctionType) + 
                                 sizeof(PATypeHandle)*(Params.size()+1)];






More information about the llvm-commits mailing list