The hasharr and hashit functions in src/admutils.c, which are used to compute the .snp / .ind hash values stored in the PACKEDANCESTRYMAP header, use signed integers that usually overflow in the middle of the computation. While unsigned-integer overflow is defined to "wrap around" in C, signed-integer overflow is "undefined behavior": compilers are allowed to assume signed-integer overflow never happens, and generate code that is correct in the no-overflow case but does weird things on overflow.
I'm guessing no existing compiler has actually done anything weird here, but it would be good to eliminate the possibility.
The
hasharrandhashitfunctions in src/admutils.c, which are used to compute the .snp / .ind hash values stored in the PACKEDANCESTRYMAP header, use signed integers that usually overflow in the middle of the computation. While unsigned-integer overflow is defined to "wrap around" in C, signed-integer overflow is "undefined behavior": compilers are allowed to assume signed-integer overflow never happens, and generate code that is correct in the no-overflow case but does weird things on overflow.I'm guessing no existing compiler has actually done anything weird here, but it would be good to eliminate the possibility.