Skip to content

Commit 69453d7

Browse files
authored
[MLIR] Fix memory leak in importWebAssemblyToModule when it fails to import (#153794)
1 parent 0fca1e4 commit 69453d7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

mlir/lib/Target/Wasm/TranslateFromWasm.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,6 +1052,8 @@ class WasmBinaryParser {
10521052
ModuleOp getModule() {
10531053
if (isValid)
10541054
return mOp;
1055+
if (mOp)
1056+
mOp.erase();
10551057
return ModuleOp{};
10561058
}
10571059

0 commit comments

Comments
 (0)