From 78c73bcde985e50b2c0f27b34e03e86736a37aa1 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Fri, 23 Apr 2021 20:09:28 -0700 Subject: [PATCH] anticipate a -2 return from seg_cmp indicating an error Related to #1801. --- lib/ortho/ortho.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/ortho/ortho.c b/lib/ortho/ortho.c index becbf37a0..7926b5929 100644 --- a/lib/ortho/ortho.c +++ b/lib/ortho/ortho.c @@ -756,9 +756,11 @@ add_edges_in_G(channel* cp) for(x=0;x+1 0) { + if (cmp == -2) { + return -1; + } else if (cmp > 0) { insert_edge(G,x,y); - } else if (cmp < 0) { + } else if (cmp == -1) { insert_edge(G,y,x); } } @@ -868,6 +870,9 @@ decide_point(pair *ret, segment* si, segment* sj, int dir1, int dir2) assert(0); /* FIXME */ else { temp = seg_cmp(np1, np2); + if (temp == -2) { + return -1; + } prec = propagate_prec(np1, temp, ans+1, 1-dir1); } -- 2.50.1