Skip to content

Commit 2533518

Browse files
authored
[SYCL][ESIMD] Move RAII deleter init after buffer allocation. (#17706)
The buffer seems to be allocated in the call to `NameNode->print(NameBuf)`, so we need to move the RAII deleter after that call, otherwise the buffer keeps leaking because when the RAII deleter is created, there's no buffer yet.
1 parent 999c682 commit 2533518

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/SYCLLowerIR/ESIMD/ESIMDVerifier.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,8 @@ class ESIMDVerifierImpl {
164164
continue;
165165

166166
id::OutputBuffer NameBuf;
167-
BuffDeleter NameBufDeleter(NameBuf.getBuffer());
168167
NameNode->print(NameBuf);
168+
BuffDeleter NameBufDeleter(NameBuf.getBuffer());
169169
StringRef Name(NameBuf.getBuffer(), NameBuf.getCurrentPosition());
170170

171171
// We are interested in functions defined in SYCL namespace, but

0 commit comments

Comments
 (0)