浏览代码

Make sure we don't overflow the next_req array

Samuel Thibault 13 年之前
父节点
当前提交
24a2f14d6b
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      src/datawizard/coherency.c

+ 3 - 1
src/datawizard/coherency.c

@@ -443,8 +443,10 @@ struct _starpu_data_request *_starpu_create_request_to_fetch_data(starpu_data_ha
 
 		if (hop != nhops - 1)
 		{
-			if (!reused_requests[hop + 1])
+			if (!reused_requests[hop + 1]) {
 				r->next_req[r->next_req_count++] = requests[hop + 1];
+				STARPU_ASSERT(r->next_req_count <= STARPU_MAXNODES);
+			}
 		}
 		else
 			_starpu_data_request_append_callback(r, callback_func, callback_arg);