diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2018-02-02 13:44:41 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2018-02-02 13:44:41 +0000 |
commit | 31766e6833851fc0eeec9eabaa800a8edaa53c60 (patch) | |
tree | 5f72113b0c35cb7b1853573e3576880530b3dca3 /libgcc | |
parent | eece7fe533e3741706d960d7cf0bae7fd0fc2755 (diff) | |
download | gcc-31766e6833851fc0eeec9eabaa800a8edaa53c60.zip gcc-31766e6833851fc0eeec9eabaa800a8edaa53c60.tar.gz gcc-31766e6833851fc0eeec9eabaa800a8edaa53c60.tar.bz2 |
compiler: don't incorrectly evaluate range variable
The language spec says that in `for i = range x`, in which there is no
second iteration variable, if len(x) is constant, then x is not
evaluated. This only matters when x is an expression that panics but
whose type is an array type; in such a case, we should not evaluate x,
since len of any array type is a constant.
Fixes golang/go#22313
Reviewed-on: https://go-review.googlesource.com/91555
From-SVN: r257330
Diffstat (limited to 'libgcc')
0 files changed, 0 insertions, 0 deletions