Skip to content

Commit 922e7d0

Browse files
maarquitos14KornevNikita
authored andcommitted
[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 aa81db8 commit 922e7d0

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
@@ -162,8 +162,8 @@ class ESIMDVerifierImpl {
162162
continue;
163163

164164
id::OutputBuffer NameBuf;
165-
BuffDeleter NameBufDeleter(NameBuf.getBuffer());
166165
NameNode->print(NameBuf);
166+
BuffDeleter NameBufDeleter(NameBuf.getBuffer());
167167
StringRef Name(NameBuf.getBuffer(), NameBuf.getCurrentPosition());
168168

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

0 commit comments

Comments
 (0)