Fix memory leak introduced by llvmorg-11-init-11960-gbab6df86aef.

This commit is contained in:
Richard Smith 2020-04-15 19:38:49 -07:00
parent 9ff344ef6b
commit 1765edbb56
1 changed files with 3 additions and 0 deletions

View File

@ -3246,6 +3246,9 @@ APValue &MSGuidDecl::getAsAPValue() const {
Arr.getArrayInitializedElt(I) =
APValue(APSInt(APInt(8, PartVal.Part4And5[I]), true));
}
// Register this APValue to be destroyed if necessary. (Note that the
// MSGuidDecl destructor is never run.)
getASTContext().addDestruction(&APVal);
}
return APVal;