Parcourir la source

tools/starpu_replay.c: check pointer is valid before accessing it

Nathalie Furmento il y a 6 ans
Parent
commit
a09c6a5f36
1 fichiers modifiés avec 2 ajouts et 1 suppressions
  1. 2 1
      tools/starpu_replay.c

+ 2 - 1
tools/starpu_replay.c

@@ -308,12 +308,13 @@ void reset(void)
 
 void fix_wontuse_handle(struct task * wontuseTask)
 {
+	STARPU_ASSERT(wontuseTask);
+
 	if (!wontuseTask->reg_signal)
 		/* Data was already registered when we created this task, so it's already a handle */
 		return;
 
 	struct handle *handle_tmp;
-	STARPU_ASSERT(wontuseTask);
 
 	/* Data was not registered when we created this task, so this is the application pointer, look it up now */
 	HASH_FIND(hh, handles_hash, &wontuseTask->task.handles[0], sizeof(wontuseTask->task.handles[0]), handle_tmp);