File tree 1 file changed +11
-6
lines changed
source/loader/layers/sanitizer/asan
1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -721,7 +721,10 @@ ur_result_t AsanInterceptor::prepareLaunch(
721
721
ContextInfo->Handle , DeviceInfo->Handle , (uptr)Ptr )) {
722
722
ReportInvalidKernelArgument (Kernel, ArgIndex, (uptr)Ptr ,
723
723
ValidateResult, PtrPair.second );
724
- exitWithErrors ();
724
+ if (ValidateResult.Type !=
725
+ ValidateUSMResult::MAYBE_HOST_POINTER) {
726
+ exitWithErrors ();
727
+ }
725
728
}
726
729
}
727
730
}
@@ -864,13 +867,15 @@ AsanInterceptor::findAllocInfoByAddress(uptr Address) {
864
867
std::shared_lock<ur_shared_mutex> Guard (m_AllocationMapMutex);
865
868
auto It = m_AllocationMap.upper_bound (Address);
866
869
if (It == m_AllocationMap.begin ()) {
867
- return std::optional<AllocationIterator>{} ;
870
+ return std::nullopt ;
868
871
}
869
872
--It;
870
- // Make sure we got the right AllocInfo
871
- assert (Address >= It->second ->AllocBegin &&
872
- Address < It->second ->AllocBegin + It->second ->AllocSize &&
873
- " Wrong AllocInfo for the address" );
873
+
874
+ // Maybe it's a host pointer
875
+ if (Address < It->second ->AllocBegin ||
876
+ Address >= It->second ->AllocBegin + It->second ->AllocSize ) {
877
+ return std::nullopt;
878
+ }
874
879
return It;
875
880
}
876
881
You can’t perform that action at this time.
0 commit comments