Skip to content

Commit 6213202

Browse files
committed
Make bug fix a separate commit
Signed-off-by: jinge90 <[email protected]>
1 parent 5eee9e3 commit 6213202

File tree

1 file changed

+6
-20
lines changed

1 file changed

+6
-20
lines changed

source/loader/layers/sanitizer/asan_interceptor.cpp

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -537,28 +537,14 @@ ur_result_t SanitizerInterceptor::enqueueAllocInfo(
537537
}
538538

539539
// Left red zone
540-
uptr LeftRZSize = AllocInfo->UserBegin - AllocInfo->AllocBegin;
541-
if (LeftRZSize != 0) {
542-
UR_CALL(enqueueMemSetShadow(Context, Device, Queue,
543-
AllocInfo->AllocBegin, LeftRZSize,
544-
ShadowByte, LastEvent, &LastEvent));
545-
} else {
546-
context.logger.debug(
547-
"Try to create empty left red zone, Alloc Begin {}",
548-
(void *)AllocInfo->AllocBegin);
549-
}
540+
UR_CALL(enqueueMemSetShadow(Context, Device, Queue, AllocInfo->AllocBegin,
541+
AllocInfo->UserBegin - AllocInfo->AllocBegin,
542+
ShadowByte, LastEvent, &LastEvent));
550543

551544
// Right red zone
552-
uptr RightRZSize = TailEnd - TailBegin;
553-
if (RightRZSize != 0) {
554-
UR_CALL(enqueueMemSetShadow(Context, Device, Queue, TailBegin,
555-
RightRZSize, ShadowByte, LastEvent,
556-
&LastEvent));
557-
} else {
558-
context.logger.debug(
559-
"Try to create empty right red zone, Alloc Begin {}",
560-
(void *)TailBegin);
561-
}
545+
UR_CALL(enqueueMemSetShadow(Context, Device, Queue, TailBegin,
546+
TailEnd - TailBegin, ShadowByte, LastEvent,
547+
&LastEvent));
562548

563549
return UR_RESULT_SUCCESS;
564550
}

0 commit comments

Comments
 (0)