This function was broken in commit 659b0e81; some downstream code expects bits_sign to be e.g. indexable.
659b0e81