From 301d41f89fc47ce207b7355145a27b3f30b6796d Mon Sep 17 00:00:00 2001
From: Matthieu Schaller <schaller@strw.leidenuniv.nl>
Date: Thu, 14 Feb 2019 22:34:05 +0100
Subject: [PATCH] Prevent FPE in in task_overlap(). But that FPE should not be
 there in the first place...

---
 src/task.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/task.c b/src/task.c
index 036e816715..12c13b9700 100644
--- a/src/task.c
+++ b/src/task.c
@@ -266,6 +266,9 @@ float task_overlap(const struct task *restrict ta,
     if (tb->ci != NULL) size_union += tb->ci->hydro.count;
     if (tb->cj != NULL) size_union += tb->cj->hydro.count;
 
+    // MATTHIEU: This should not be necessary
+    if (size_union == 0) return 0.f;
+    
     /* Compute the intersection of the cell data. */
     const size_t size_intersect = task_cell_overlap_part(ta->ci, tb->ci) +
                                   task_cell_overlap_part(ta->ci, tb->cj) +
-- 
GitLab