]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: fix constant index bounds check and error message
authorRobert Griesemer <gri@golang.org>
Wed, 28 Nov 2018 22:34:45 +0000 (14:34 -0800)
committerRobert Griesemer <gri@golang.org>
Fri, 30 Nov 2018 23:48:00 +0000 (23:48 +0000)
commita37d95c74a68da299073ff5a5bb077aa60aeab39
treeff8a5756f9fc4536a91aa321cd4a3e6f9910b443
parentd029058b5912312963225c40ae4bf44e3cb4be76
cmd/compile: fix constant index bounds check and error message

While here, rename nonnegintconst to indexconst (because that's
what it is) and add Fatalf calls where we are not expecting the
indexconst call to fail, and fixed wrong comparison in smallintconst.

Fixes #23781.

Change-Id: I86eb13081c450943b1806dfe3ae368872f76639a
Reviewed-on: https://go-review.googlesource.com/c/151599
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/gc/const.go
src/cmd/compile/internal/gc/sinit.go
src/cmd/compile/internal/gc/typecheck.go
src/cmd/compile/internal/gc/walk.go
test/fixedbugs/issue23781.go [new file with mode: 0644]