Skip to content

Commit 075dc98

Browse files
committed
Fix CID 1393671 (Uninitialized scalar variable)
Signed-off-by: Stefan Weil <[email protected]>
1 parent 8f33d10 commit 075dc98

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/opencl/openclwrapper.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -2512,13 +2512,13 @@ static ds_status evaluateScoreForDevice(ds_device *device, void *inputData) {
25122512
device->type == DS_DEVICE_OPENCL_DEVICE ? "OpenCL" : "Native");
25132513
GPUEnv *env = nullptr;
25142514
if (device->type == DS_DEVICE_OPENCL_DEVICE) {
2515-
env = new GPUEnv;
2515+
env = &OpenclDevice::gpuEnv;
2516+
memset(env, 0, sizeof(*env));
25162517
// printf("[DS] populating tmp GPUEnv from device\n");
25172518
populateGPUEnvFromDevice(env, device->oclDeviceID);
25182519
env->mnFileCount = 0; // argc;
25192520
env->mnKernelCount = 0UL;
25202521
// printf("[DS] compiling kernels for tmp GPUEnv\n");
2521-
OpenclDevice::gpuEnv = *env;
25222522
OpenclDevice::CompileKernelFile(env, "");
25232523
}
25242524

0 commit comments

Comments
 (0)