fix: add checks to avoid invalid behavior

Related-To: NEO-9038
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2023-10-05 14:42:21 +00:00
committed by Compute-Runtime-Automation
parent 0c8a514349
commit ece03e6bbf
3 changed files with 7 additions and 2 deletions

View File

@@ -226,7 +226,9 @@ int BinaryEncoder::processKernel(size_t &line, const std::vector<std::string> &p
// Write KernelName and padding // Write KernelName and padding
kernelBlob.write(kernelName.c_str(), kernelName.size()); kernelBlob.write(kernelName.c_str(), kernelName.size());
addPadding(kernelBlob, kernelNameSizeInBinary - kernelName.size()); if (kernelNameSizeInBinary > kernelName.size()) {
addPadding(kernelBlob, kernelNameSizeInBinary - kernelName.size());
}
// Write KernelHeap and padding // Write KernelHeap and padding
uint32_t kernelHeapSizeUnpadded = 0U; uint32_t kernelHeapSizeUnpadded = 0U;

View File

@@ -200,6 +200,7 @@ StorageInfo MemoryManager::createStorageInfoFromProperties(const AllocationPrope
} }
} }
if (DebugManager.flags.ForceSingleTileAllocPlacement.get()) { if (DebugManager.flags.ForceSingleTileAllocPlacement.get()) {
UNRECOVERABLE_IF(properties.allocationType == AllocationType::UNKNOWN);
if ((1llu << (static_cast<int64_t>(properties.allocationType) - 1)) & DebugManager.flags.ForceSingleTileAllocPlacement.get()) { if ((1llu << (static_cast<int64_t>(properties.allocationType) - 1)) & DebugManager.flags.ForceSingleTileAllocPlacement.get()) {
storageInfo.cloningOfPageTables = true; storageInfo.cloningOfPageTables = true;
storageInfo.memoryBanks = preferredTile; storageInfo.memoryBanks = preferredTile;

View File

@@ -46,7 +46,9 @@ class Timer::TimerImpl {
} }
TimerImpl &operator=(const TimerImpl &t) { TimerImpl &operator=(const TimerImpl &t) {
startTime = t.startTime; if (this != &t) {
startTime = t.startTime;
}
return *this; return *this;
} }