From ec3d65b870c31a80932c5a2c510cbd21e0122564 Mon Sep 17 00:00:00 2001 From: Heejin Ahn Date: Fri, 28 Sep 2018 20:54:04 +0000 Subject: [PATCH] [WebAssembly] Fix memory leak on WasmEHFuncInfo Summary: WasmEHFuncInfo objects were not being properly deleted. Reviewers: dschuff Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D52582 llvm-svn: 343362 --- llvm/lib/CodeGen/MachineFunction.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp index ecf913f..8603a1e 100644 --- a/llvm/lib/CodeGen/MachineFunction.cpp +++ b/llvm/lib/CodeGen/MachineFunction.cpp @@ -246,6 +246,11 @@ void MachineFunction::clear() { WinEHInfo->~WinEHFuncInfo(); Allocator.Deallocate(WinEHInfo); } + + if (WasmEHInfo) { + WasmEHInfo->~WasmEHFuncInfo(); + Allocator.Deallocate(WasmEHInfo); + } } const DataLayout &MachineFunction::getDataLayout() const { -- 2.7.4