From 54bac569a66d4d825bb0fda9aa803bf47d3fa1c6 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Wed, 19 Sep 2007 21:57:06 +0200 Subject: [PATCH] evalue.c: emul: handle another special case --- evalue.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/evalue.c b/evalue.c index ba9ffa2..52adff0 100644 --- a/evalue.c +++ b/evalue.c @@ -1639,6 +1639,18 @@ if((value_zero_p(e1->d)&&e1->x.p->type==evector)||(value_zero_p(res->d)&&(res->x if (EVALUE_IS_ONE(*e1)) return; + if (EVALUE_IS_ZERO(*e1)) { + if (value_notzero_p(res->d)) { + value_assign(res->d, e1->d); + value_assign(res->x.n, e1->x.n); + } else { + free_evalue_refs(res); + value_init(res->d); + evalue_set_si(res, 0, 1); + } + return; + } + if (value_zero_p(e1->d) && e1->x.p->type == partition) { if (value_zero_p(res->d) && res->x.p->type == partition) emul_partitions(e1, res); @@ -1787,7 +1799,8 @@ if((value_zero_p(e1->d)&&e1->x.p->type==evector)||(value_zero_p(res->d)&&(res->x emul(&d, &tmp); eadd(&res->x.p->arr[1], &tmp); emul(&e1->x.p->arr[2], &tmp); - emul(&e1->x.p->arr[1], res); + emul(&e1->x.p->arr[1], &res->x.p->arr[1]); + emul(&e1->x.p->arr[1], &res->x.p->arr[2]); eadd(&tmp, &res->x.p->arr[2]); free_evalue_refs(&tmp); value_clear(d.x.n); -- 2.11.4.GIT