summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/state_trackers/clover/core/kernel.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/clover/core/kernel.cpp b/src/gallium/state_trackers/clover/core/kernel.cpp
index 955ff7b3955..a226ec1a752 100644
--- a/src/gallium/state_trackers/clover/core/kernel.cpp
+++ b/src/gallium/state_trackers/clover/core/kernel.cpp
@@ -367,6 +367,9 @@ kernel::scalar_argument::scalar_argument(size_t size) : size(size) {
void
kernel::scalar_argument::set(size_t size, const void *value) {
+ if (!value)
+ throw error(CL_INVALID_ARG_VALUE);
+
if (size != this->size)
throw error(CL_INVALID_ARG_SIZE);
@@ -435,6 +438,9 @@ kernel::local_argument::set(size_t size, const void *value) {
if (value)
throw error(CL_INVALID_ARG_VALUE);
+ if (!size)
+ throw error(CL_INVALID_ARG_SIZE);
+
_storage = size;
_set = true;
}
@@ -494,6 +500,9 @@ kernel::constant_argument::unbind(exec_context &ctx) {
void
kernel::image_rd_argument::set(size_t size, const void *value) {
+ if (!value)
+ throw error(CL_INVALID_ARG_VALUE);
+
if (size != sizeof(cl_mem))
throw error(CL_INVALID_ARG_SIZE);
@@ -522,6 +531,9 @@ kernel::image_rd_argument::unbind(exec_context &ctx) {
void
kernel::image_wr_argument::set(size_t size, const void *value) {
+ if (!value)
+ throw error(CL_INVALID_ARG_VALUE);
+
if (size != sizeof(cl_mem))
throw error(CL_INVALID_ARG_SIZE);
@@ -550,6 +562,9 @@ kernel::image_wr_argument::unbind(exec_context &ctx) {
void
kernel::sampler_argument::set(size_t size, const void *value) {
+ if (!value)
+ throw error(CL_INVALID_SAMPLER);
+
if (size != sizeof(cl_sampler))
throw error(CL_INVALID_ARG_SIZE);