diff options
Diffstat (limited to 'llvm/lib/VMCore')
| -rw-r--r-- | llvm/lib/VMCore/Type.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/VMCore/Type.cpp b/llvm/lib/VMCore/Type.cpp index 0e74f2e4f89..ace800dfb2b 100644 --- a/llvm/lib/VMCore/Type.cpp +++ b/llvm/lib/VMCore/Type.cpp @@ -1098,7 +1098,11 @@ FunctionType *FunctionType::get(const Type *ReturnType, 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)]; |

