MCPcopy Create free account
hub / github.com/MultiFuzz/MultiFuzz / get_new_bits

Function get_new_bits

hail-fuzz/src/coverage.rs:90–104  ·  view source on GitHub ↗

Return the index of any bits within `new` not set in `existing`.

(existing: &[u64], new: &[u64])

Source from the content-addressed store, hash-verified

88
89/// Return the index of any bits within `new` not set in `existing`.
90pub fn get_new_bits(existing: &[u64], new: &[u64]) -> Vec<u32> {
91 let mut new_bits = vec![];
92 for (i, (&old, &new)) in existing.iter().zip(new).enumerate() {
93 if old | new == old {
94 continue;
95 }
96
97 for j in 0..64 {
98 if ((old & (1 << j)) == 0) && ((new & (1 << j)) != 0) {
99 new_bits.push((i * 64 + j).try_into().unwrap());
100 }
101 }
102 }
103 new_bits
104}
105
106/// Or the bits from `new` with `old` returning the total number of bits set.
107#[cold]

Callers 1

new_bitsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected