Skip to content

Commit 4e7b777

Browse files
bwlodarczsys-ce-bb
authored andcommitted
Memory leak fix in SPIRVDecoder::getSourceContinuedInstructions (intel#2259)
SPIRVEntry created in function getEntry isn't deleted when it is ExtOp and isn't SourceContinued. Original commit: KhronosGroup/SPIRV-LLVM-Translator@b891a51
1 parent 73abcef commit 4e7b777

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

llvm-spirv/lib/SPIRV/libSPIRV/SPIRVStream.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,7 @@ std::vector<SPIRVEntry *> SPIRVDecoder::getSourceContinuedInstructions() {
357357
SPIRVExtInst *Inst = static_cast<SPIRVExtInst *>(Entry);
358358
if (Inst->getExtOp() != SPIRVDebug::Instruction::SourceContinued) {
359359
IS.seekg(Pos); // restore position
360+
delete Entry;
360361
return ContinuedInst;
361362
}
362363
M.add(Entry);

0 commit comments

Comments
 (0)