Skip to content

Commit 0afc3e3

Browse files
authored
fix the argindex of invalid argument (#2114)
1 parent ea13b2f commit 0afc3e3

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

source/loader/layers/sanitizer/asan_report.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,26 +180,27 @@ void ReportInvalidKernelArgument(ur_kernel_handle_t Kernel, uint32_t ArgIndex,
180180
break;
181181
case ValidateUSMResult::RELEASED_POINTER:
182182
getContext()->logger.always(
183-
"The {}th argument {} is a released USM pointer", ArgIndex,
183+
"The {}th argument {} is a released USM pointer", ArgIndex + 1,
184184
(void *)Addr);
185185
PrintAllocateInfo(Addr, AI.get());
186186
break;
187187
case ValidateUSMResult::BAD_CONTEXT:
188188
getContext()->logger.always(
189-
"The {}th argument {} is allocated in other context", ArgIndex,
189+
"The {}th argument {} is allocated in other context", ArgIndex + 1,
190190
(void *)Addr);
191191
PrintAllocateInfo(Addr, AI.get());
192192
break;
193193
case ValidateUSMResult::BAD_DEVICE:
194194
getContext()->logger.always(
195-
"The {}th argument {} is allocated in other device", ArgIndex,
195+
"The {}th argument {} is allocated in other device", ArgIndex + 1,
196196
(void *)Addr);
197197
PrintAllocateInfo(Addr, AI.get());
198198
break;
199199
case ValidateUSMResult::OUT_OF_BOUNDS:
200200
getContext()->logger.always(
201201
"The {}th argument {} is located outside of its region [{}, {})",
202-
ArgIndex, (void *)Addr, (void *)AI->UserBegin, (void *)AI->UserEnd);
202+
ArgIndex + 1, (void *)Addr, (void *)AI->UserBegin,
203+
(void *)AI->UserEnd);
203204
getContext()->logger.always("allocated here:");
204205
AI->AllocStack.print();
205206
break;

0 commit comments

Comments
 (0)