Skip to content

Commit 8b66db7

Browse files
ianaylKornevNikita
authored andcommitted
[SYCL][Coverity] Fix invalid iterator coverity hit (#17944)
In `ProgramManager::removeImages`, we cleanup our KernelName2KernelID mapping, before using that exact mapping retrieve KernelIDs in order to clean up our KernelIDs2BinImage mapping. This PR cleans up `m_KernelID2BinImage` mapping before cleaning up `m_KernelName2KernelIDs` maping. This is inteded to fix a hit raised by Coverity.
1 parent 1219a36 commit 8b66db7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sycl/source/detail/program_manager/program_manager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2174,8 +2174,8 @@ void ProgramManager::removeImages(sycl_device_binaries DeviceBinary) {
21742174

21752175
if (auto It = m_KernelName2KernelIDs.find(EntriesIt->GetName());
21762176
It != m_KernelName2KernelIDs.end()) {
2177-
m_KernelName2KernelIDs.erase(It);
21782177
m_KernelIDs2BinImage.erase(It->second);
2178+
m_KernelName2KernelIDs.erase(It);
21792179
}
21802180
}
21812181

0 commit comments

Comments
 (0)