[Mlir-commits] [mlir] [mlir][ROCDL] Fix file leak in SeralizeToHsaco and its newer form (PR #67711)

Mehdi Amini llvmlistbot at llvm.org
Thu Sep 28 18:05:00 PDT 2023


================
@@ -410,6 +410,8 @@ SerializeToHsacoPass::createHsaco(const SmallVectorImpl<char> &isaBinary) {
     return {};
   }
   llvm::FileRemover cleanupHsaco(tempHsacoFilename);
+  // Prevent file descriptor leak.
+  llvm::sys::fs::closeFile(tempHsacoFD);
----------------
joker-eph wrote:

There is a `createTemporaryFile` that does not take a `fd`, why not use this one instead?

https://github.com/llvm/llvm-project/pull/67711


More information about the Mlir-commits mailing list