fix int overflow

Needed for https://github.com/D-Programming-Language/dmd/pull/1803