Add a check for an overflow and explicitly cast the value. We would have silently overflowed previously. llvm-svn: 297291