Skip to content

Commit b891a51

Browse files
authored
Memory leak fix in SPIRVDecoder::getSourceContinuedInstructions (#2259)
SPIRVEntry created in function getEntry isn't deleted when it is ExtOp and isn't SourceContinued.
1 parent d48e309 commit b891a51

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

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)