[PATCH] D52582: [WebAssembly] Fix memory leak on WasmEHFuncInfo

Heejin Ahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 26 17:34:20 PDT 2018


aheejin created this revision.
aheejin added a reviewer: dschuff.
Herald added subscribers: llvm-commits, sunfish, jgravelle-google, sbc100.

WasmEHFuncInfo objects were not being properly deleted.


Repository:
  rL LLVM

https://reviews.llvm.org/D52582

Files:
  lib/CodeGen/MachineFunction.cpp


Index: lib/CodeGen/MachineFunction.cpp
===================================================================
--- lib/CodeGen/MachineFunction.cpp
+++ lib/CodeGen/MachineFunction.cpp
@@ -246,6 +246,11 @@
     WinEHInfo->~WinEHFuncInfo();
     Allocator.Deallocate(WinEHInfo);
   }
+
+  if (WasmEHInfo) {
+    WasmEHInfo->~WasmEHFuncInfo();
+    Allocator.Deallocate(WasmEHInfo);
+  }
 }
 
 const DataLayout &MachineFunction::getDataLayout() const {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52582.167220.patch
Type: text/x-patch
Size: 445 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180927/c2d84e76/attachment.bin>


More information about the llvm-commits mailing list