[clang][Interp] Make sure we free() allocated InitMaps
authorTimm Bäder <tbaeder@redhat.com>
Thu, 27 Oct 2022 09:32:31 +0000 (11:32 +0200)
committerTimm Bäder <tbaeder@redhat.com>
Fri, 28 Oct 2022 15:00:15 +0000 (17:00 +0200)
commitee9bbfa5e6acaea6d2a116bc29b7086441f86b6a
tree4e93f8a83d549039b0fd717a0902f3c99fa0020a
parent38ffc89c87ac3b0b1c2173728fba2258dead9ae0
[clang][Interp] Make sure we free() allocated InitMaps

They get allocated when calling initialize() on a primitive array. And
they get free'd when the array is fully initialized. However, when that
never happens, they get leaked. Fix that by calling the destructor of
global variables.

Differential Revision: https://reviews.llvm.org/D136826
clang/lib/AST/Interp/Descriptor.cpp
clang/lib/AST/Interp/InterpBlock.h
clang/lib/AST/Interp/Pointer.cpp
clang/lib/AST/Interp/Program.cpp
clang/lib/AST/Interp/Program.h