Remove a memory leak, until ParamAttrsList is uniqued.
llvm-svn: 35823
This commit is contained in:
parent
03d7ae3a74
commit
8684923644
|
@ -1098,7 +1098,11 @@ FunctionType *FunctionType::get(const Type *ReturnType,
|
||||||
|
|
||||||
FunctionValType VT(ReturnType, Params, isVarArg, Attrs);
|
FunctionValType VT(ReturnType, Params, isVarArg, Attrs);
|
||||||
FunctionType *MT = FunctionTypes->get(VT);
|
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) +
|
MT = (FunctionType*) new char[sizeof(FunctionType) +
|
||||||
sizeof(PATypeHandle)*(Params.size()+1)];
|
sizeof(PATypeHandle)*(Params.size()+1)];
|
||||||
|
|
Loading…
Reference in New Issue