Преглед на файлове

Avoid zero-lengthed VLA

Samuel Thibault преди 9 години
родител
ревизия
3dd99bf440
променени са 1 файла, в които са добавени 4 реда и са изтрити 1 реда
  1. 4 1
      src/util/openmp_runtime_support.c

+ 4 - 1
src/util/openmp_runtime_support.c

@@ -1560,7 +1560,10 @@ void starpu_omp_task_region(const struct starpu_omp_task_region_attr *attr)
 			/* TODO: backup current ICVs and setup new ICVs for the included task */
 		}
 		int i;
-		void *data_interfaces[attr->cl.nbuffers];
+		unsigned n = attr->cl.nbuffers;
+		if (n == 0)
+			n = 1;
+		void *data_interfaces[n];
 		for (i = 0; i < attr->cl.nbuffers; i++)
 		{
 			starpu_data_handle_t handle = attr->handles[i];