Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions source/loader/layers/sanitizer/asan/asan_interceptor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,10 @@ ur_result_t AsanInterceptor::prepareLaunch(
ContextInfo->Handle, DeviceInfo->Handle, (uptr)Ptr)) {
ReportInvalidKernelArgument(Kernel, ArgIndex, (uptr)Ptr,
ValidateResult, PtrPair.second);
exitWithErrors();
if (ValidateResult.Type !=
ValidateUSMResult::MAYBE_HOST_POINTER) {
exitWithErrors();
}
}
}
}
Expand Down Expand Up @@ -864,13 +867,15 @@ AsanInterceptor::findAllocInfoByAddress(uptr Address) {
std::shared_lock<ur_shared_mutex> Guard(m_AllocationMapMutex);
auto It = m_AllocationMap.upper_bound(Address);
if (It == m_AllocationMap.begin()) {
return std::optional<AllocationIterator>{};
return std::nullopt;
}
--It;
// Make sure we got the right AllocInfo
assert(Address >= It->second->AllocBegin &&
Address < It->second->AllocBegin + It->second->AllocSize &&
"Wrong AllocInfo for the address");

// Maybe it's a host pointer
if (Address < It->second->AllocBegin ||
Address >= It->second->AllocBegin + It->second->AllocSize) {
return std::nullopt;
}
return It;
}

Expand Down
Loading