I have a doubt about has_new_bits function in AFLGo.
has_new_bits do calculate the distance, but it also will change the
virgin_bits.
if we only utilize has_new_bits to calculate distance, like this:
has_new_bits(virgin_bits);
q->distance = cur_distance;
It means we don't utilize the return value of has_new_bits. My doubt is:
has_new_bits accept a pointer as its argument, which means it can modify the virgin_bits, so next time when we call has_new_bits, virgin_bits has changed, which can effect the return value, and the result of this snippet of code may be differrent:
u8 hnb = has_new_bits(virgin_bits);
if(hnb > new_bits) new_bits = hnb;
is this really OK?