commit | ecbd6562aff604b9559f63d714e922a0c9c2a77f | [log] [tgz] |
---|---|---|
author | Ian Lance Taylor <iant@golang.org> | Wed Apr 17 09:54:06 2019 -0700 |
committer | Ian Lance Taylor <iant@golang.org> | Thu Apr 18 04:10:25 2019 +0000 |
tree | eb3a4f739d0251da9ff0746869e885c9c8996411 | |
parent | 20010e494f46d8fd58cfd372093b059578d3379a [diff] |
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 Change-Id: I020a26249ab00d5828621a0ec120e3f7c790df2e Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/172663 Reviewed-by: Than McIntosh <thanm@google.com>