fix leakage of APSInt in getVal()

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58693 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Nuno Lopes 2008-11-04 14:26:58 +00:00
parent 7ecbfd1157
commit 91c2620862

View File

@ -418,6 +418,7 @@ static Value *getExistingVal(const Type *Ty, const ValID &D) {
{ {
APSInt Tmp = *D.ConstPoolInt; APSInt Tmp = *D.ConstPoolInt;
D.destroy();
Tmp.extOrTrunc(Ty->getPrimitiveSizeInBits()); Tmp.extOrTrunc(Ty->getPrimitiveSizeInBits());
return ConstantInt::get(Tmp); return ConstantInt::get(Tmp);
} }