From 899df454e3d8a6ede4d2b64939399ad4a2725b12 Mon Sep 17 00:00:00 2001 From: skimo Date: Sat, 5 Jun 2004 14:04:04 +0000 Subject: [PATCH] remove empty partitions --- ev_operations.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ev_operations.c b/ev_operations.c index ec69cde..df81b40 100644 --- a/ev_operations.c +++ b/ev_operations.c @@ -2,6 +2,7 @@ #include #include "ev_operations.h" +#include "util.h" void evalue_set_si(evalue *ev, int n, int d) { value_set_si(ev->d, d); @@ -222,6 +223,12 @@ void reduce_evalue (evalue *e) { for (i = 0; i < e->x.p->size/2; ++i) { n = 0; Polyhedron *D = EVALUE_DOMAIN(e->x.p->arr[2*i]); + /* This shouldn't really happen; + * Empty domains should not be added. + */ + if (emptyQ(D)) + goto discard; + dim = D->Dimension; if (!D->next && D->NbEq) { int j, k; @@ -257,6 +264,7 @@ void reduce_evalue (evalue *e) { } _reduce_evalue(&e->x.p->arr[2*i+1], n, fixed); if (EVALUE_IS_ZERO(e->x.p->arr[2*i+1])) { +discard: free_evalue_refs(&e->x.p->arr[2*i+1]); Domain_Free(EVALUE_DOMAIN(e->x.p->arr[2*i])); value_clear(e->x.p->arr[2*i].d); -- 2.11.4.GIT