PR go/90110
compiler: use temporary to avoid early destruction
The code was passing a substr directly to strtol, and then checking
the *end value returned by strtol. But the substr could be destroyed
as soon as strtol returns, making the test of *end invalid.
Also fix an incorrect test of the string index rather than the value.
Fixes https://gcc.gnu.org/PR90110
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/172663
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@270434
138bc75d-0d04-0410-961f-
82ee72b054a4