diff options
author | Dmitry Cherkassov <[email protected]> | 2013-03-23 23:51:22 +0400 |
---|---|---|
committer | Francisco Jerez <[email protected]> | 2013-03-24 02:43:34 +0100 |
commit | 3cc2629b3b4bfc3b5c21a5932a3a2e590e60f98a (patch) | |
tree | 31dbe40fdc2fa86760e6c53f4e640972123147b3 /src/gallium/state_trackers | |
parent | b50e362dbbced42c93fb28a420977dfecd38c823 (diff) |
clover: add dynamic_cast results checking down in clSetKernelArgument() code path.
Signed-off-by: Dmitry Cherkassov <[email protected]>
Signed-off-by: Francisco Jerez <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r-- | src/gallium/state_trackers/clover/core/kernel.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/clover/core/kernel.cpp b/src/gallium/state_trackers/clover/core/kernel.cpp index 6fa8bd63453..20dc4ca57dd 100644 --- a/src/gallium/state_trackers/clover/core/kernel.cpp +++ b/src/gallium/state_trackers/clover/core/kernel.cpp @@ -222,6 +222,9 @@ _cl_kernel::global_argument::set(size_t size, const void *value) { throw error(CL_INVALID_ARG_SIZE); obj = dynamic_cast<clover::buffer *>(*(cl_mem *)value); + if (!obj) + throw error(CL_INVALID_MEM_OBJECT); + __set = true; } @@ -286,6 +289,9 @@ _cl_kernel::constant_argument::set(size_t size, const void *value) { throw error(CL_INVALID_ARG_SIZE); obj = dynamic_cast<clover::buffer *>(*(cl_mem *)value); + if (!obj) + throw error(CL_INVALID_MEM_OBJECT); + __set = true; } @@ -316,6 +322,9 @@ _cl_kernel::image_rd_argument::set(size_t size, const void *value) { throw error(CL_INVALID_ARG_SIZE); obj = dynamic_cast<clover::image *>(*(cl_mem *)value); + if (!obj) + throw error(CL_INVALID_MEM_OBJECT); + __set = true; } @@ -346,6 +355,9 @@ _cl_kernel::image_wr_argument::set(size_t size, const void *value) { throw error(CL_INVALID_ARG_SIZE); obj = dynamic_cast<clover::image *>(*(cl_mem *)value); + if (!obj) + throw error(CL_INVALID_MEM_OBJECT); + __set = true; } |