mnemonikr / symbolic-pcode

Apache License 2.0
0 stars 0 forks source link

Fixed popcount returning 0 in all 1 values #65

Closed mnemonikr closed 1 year ago

mnemonikr commented 1 year ago

The bug was caused by using self.len().ilog2() instead of ilog2() + 1 whenever the length was a power of two. Suppose for example the length is 8, a power of two. Then the popcount of 0b1111_1111 is 8 = 0b1000 which requires 4 bits to represent. So we need to use ilog2() + 1 when it's a power of two.