Fix #4724 (Error in calculation shift operation: wrong sign: 1UL << 63)