浏览代码

Make sure a handle is initialized before trying to read it

Samuel Thibault 7 年之前
父节点
当前提交
aeea106048
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      src/core/dependencies/data_concurrency.c

+ 2 - 0
src/core/dependencies/data_concurrency.c

@@ -122,6 +122,8 @@ static unsigned _starpu_attempt_to_submit_data_request(unsigned request_from_cod
 	mode &= ~STARPU_COMMUTE;
 	mode &= ~STARPU_COMMUTE;
 	mode &= ~STARPU_SSEND;
 	mode &= ~STARPU_SSEND;
 	mode &= ~STARPU_LOCALITY;
 	mode &= ~STARPU_LOCALITY;
+	if (mode & STARPU_R)
+		STARPU_ASSERT_MSG(handle->initialized, "handle %p is not initialized while trying to read it", handle);
 	if (mode == STARPU_RW)
 	if (mode == STARPU_RW)
 		mode = STARPU_W;
 		mode = STARPU_W;