浏览代码

Coccinelle: destroy_task_on_error.cocci: make sure we do not add a call to starpu_task_destroy() after a return statement.

Cyril Roelandt 13 年之前
父节点
当前提交
592aefa0d3
共有 1 个文件被更改,包括 8 次插入0 次删除
  1. 8 0
      tools/dev/experimental/destroy_task_on_error.cocci

+ 8 - 0
tools/dev/experimental/destroy_task_on_error.cocci

@@ -95,10 +95,18 @@ f(...)
 {
 <+...
 if@p (...)
+(
 {
 ...
 + starpu_task_destroy(t);
+return ...;
 }
+|
+{
+...
++ starpu_task_destroy(t);
+}
+)
 ...+>
 }