Make sure we don't return bits outside the mask in ComputeMaskedBits. PR12189.