Fixed r22565: we have signed values.
authorSebastian Buchwald <Sebastian.Buchwald@kit.edu>
Tue, 7 Oct 2008 12:26:31 +0000 (12:26 +0000)
committerSebastian Buchwald <Sebastian.Buchwald@kit.edu>
Tue, 7 Oct 2008 12:26:31 +0000 (12:26 +0000)
[r22570]

vector.c

index d0465de..0a36f59 100644 (file)
--- 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;