Skip to content

Commit 59f15de

Browse files
authored
Memory leaks fix in SPIRVFunction::decodeBB (#2268)
SPIRVEntry is created by function getEntry() but not deleted in a few frame ending branches.
1 parent 17a5d2d commit 59f15de

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/SPIRV/libSPIRV/SPIRVFunction.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ bool SPIRVFunction::decodeBB(SPIRVDecoder &Decoder) {
153153
std::to_string(Entry->getOpCode()))) {
154154
// Bail out if the opcode is not implemented.
155155
Module->setInvalid();
156+
delete Entry;
156157
return false;
157158
}
158159

@@ -164,6 +165,7 @@ bool SPIRVFunction::decodeBB(SPIRVDecoder &Decoder) {
164165
SPIRVDebug::DebugNoLine) ||
165166
Inst->isExtInst(SPIRVEIS_NonSemantic_Shader_DebugInfo_200,
166167
SPIRVDebug::DebugNoLine)) {
168+
delete Entry;
167169
continue;
168170
} else if (Inst->isExtInst(SPIRVEIS_NonSemantic_Shader_DebugInfo_100,
169171
SPIRVDebug::DebugLine) ||

0 commit comments

Comments
 (0)