projects
/
libfirm
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2274f0d
)
Fixed r22565: we have signed values.
author
Sebastian Buchwald
<Sebastian.Buchwald@kit.edu>
Tue, 7 Oct 2008 12:26:31 +0000
(12:26 +0000)
committer
Sebastian Buchwald
<Sebastian.Buchwald@kit.edu>
Tue, 7 Oct 2008 12:26:31 +0000
(12:26 +0000)
[r22570]
vector.c
patch
|
blob
|
history
diff --git
a/vector.c
b/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;