Skip to content

Commit

Permalink
Fix CL_KERNEL_ATTRIBUTES query (#567)
Browse files Browse the repository at this point in the history
The api_query_string is destroyed before we copy from it.
Should have been caught in testing/code review.

Change-Id: I4998d9b2518f10e2e1efbee4b42edc0014561432

Signed-off-by: Kévin Petit <kpet@free.fr>
  • Loading branch information
kpet authored Jul 1, 2023
1 parent a80c62b commit 52edb12
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2861,6 +2861,7 @@ cl_int CLVK_API_CALL clGetKernelInfo(cl_kernel kern, cl_kernel_info param_name,
cl_uint val_uint;
cl_context val_context;
cl_program val_program;
api_query_string val_string;

auto kernel = icd_downcast(kern);

Expand Down Expand Up @@ -2894,9 +2895,9 @@ cl_int CLVK_API_CALL clGetKernelInfo(cl_kernel kern, cl_kernel_info param_name,
ret_size = sizeof(val_program);
break;
case CL_KERNEL_ATTRIBUTES: {
const api_query_string attrs = kernel->attributes();
copy_ptr = attrs.c_str();
ret_size = attrs.size_with_null();
val_string = kernel->attributes();
copy_ptr = val_string.c_str();
ret_size = val_string.size_with_null();
break;
}
default:
Expand Down

0 comments on commit 52edb12

Please sign in to comment.