From: Sebastian Buchwald Date: Tue, 7 Oct 2008 12:26:31 +0000 (+0000) Subject: Fixed r22565: we have signed values. X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=0cb8393236b4b7b40059505f1e4fcf2d28183bc8;p=libfirm Fixed r22565: we have signed values. [r22570] --- diff --git a/vector.c b/vector.c index d0465de0c..0a36f594c 100644 --- a/vector.c +++ b/vector.c @@ -11,8 +11,15 @@ num pbqp_add(num x, num y) num res = x + y; - assert(res >= x); - assert(res >= y); + /* No positive overflow. */ + assert(x < 0 || y < 0 || res >= x); + assert(x < 0 || y < 0 || res >= y); + + /* No negative overflow. */ + assert(x > 0 || y > 0 || res <= x); + assert(x > 0 || y > 0 || res <= y); + + /* Result is not infinity.*/ assert(res < INF_COSTS); return res;