Fix arithmetic error cause by a misuse of xor bitwise operator (^)

Merged François Grisez requested to merge fix/arithmetic_error into release/4.3

Merge request reports