Skip to content

Commit 4ac0678

Browse files
committed
wip
1 parent 9283535 commit 4ac0678

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

source/loader/layers/sanitizer/msan/msan_ddi.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1390,7 +1390,10 @@ ur_result_t UR_APICALL urEnqueueUSMMemcpy(
13901390

13911391
if (phEvent) {
13921392
*phEvent = hEvent;
1393+
} else {
1394+
getContext()->urDdiTable.Event.pfnWait(1, &hEvent);
13931395
}
1396+
// getContext()->urDdiTable.Queue.pfnFinish(hQueue);
13941397

13951398
return UR_RESULT_SUCCESS;
13961399
}

source/loader/layers/sanitizer/msan/msan_interceptor.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -386,13 +386,13 @@ MsanInterceptor::findAllocInfoByAddress(uptr Address) {
386386
std::shared_lock<ur_shared_mutex> Guard(m_AllocationMapMutex);
387387
auto It = m_AllocationMap.upper_bound(Address);
388388
if (It == m_AllocationMap.begin()) {
389-
return std::optional<MsanAllocationIterator>{};
389+
return std::nullopt;
390390
}
391391
--It;
392-
// Make sure we got the right MsanAllocInfo
393-
assert(Address >= It->second->AllocBegin &&
394-
Address < It->second->AllocBegin + It->second->AllocSize &&
395-
"Wrong MsanAllocInfo for the address");
392+
393+
if (Address < It->second->AllocBegin || Address >= It->second->AllocBegin + It->second->AllocSize) {
394+
return std::nullopt;
395+
}
396396
return It;
397397
}
398398

0 commit comments

Comments
 (0)