check for overflow
Casting to INT64 first is correct here.

This reverts commit 806cc2fd28f3315d8aedf8325f8b85139439023c.