projects
/
swift-upb.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2f0d0d1
)
Fixed integer overflow in method bin64_t::to().
author
Alexander G. Pronchenkov
<the.zett@gmail.com>
Tue, 26 Jan 2010 11:35:42 +0000
(16:35 +0500)
committer
Alexander G. Pronchenkov
<the.zett@gmail.com>
Tue, 26 Jan 2010 11:44:45 +0000
(16:44 +0500)
Symptom: ALL.left() == ALL.right() == ALL
bin64.h
patch
|
blob
|
history
diff --git
a/bin64.h
b/bin64.h
index
9045fe7
..
3550f22
100644
(file)
--- a/
bin64.h
+++ b/
bin64.h
@@
-93,10
+93,10
@@
struct bin64_t {
bin64_t to (bool right) const {
if (!(v&1))
return NONE;
- uint64_t tb =
tail_bit()>>
1;
+ uint64_t tb =
((tail_bits() >> 1) + 1) >>
1;
if (right)
-
tb |= (tb<<1
);
- return bin64_t(v
^
tb);
+
return bin64_t(v + tb
);
+ return bin64_t(v
^
tb);
}
/** Get the left child bin. */