]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: add sliceBound
authorJosh Bleecher Snyder <josharian@gmail.com>
Thu, 31 Mar 2016 16:29:39 +0000 (09:29 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Thu, 31 Mar 2016 18:41:30 +0000 (18:41 +0000)
commite775b8df7a073824e445b64742f3bc4dc4fa6f3d
tree7b0a6db6b78742b48abdaf48fba50833ad6cd94c
parent4b95575bd4baa683bf1c5b75bd42adf8ab2871af
cmd/compile: add sliceBound

Add a constant for the magic -1 for slice bounds.
Use it.
Enforce more aggressively that bounds must be
slice, ddd, or non-negative.
Remove ad hoc check in plive.go.
Check bounds before constructing an array type
when typechecking.

All changes are manual.

Passes toolstash -cmp.

Change-Id: I9fd9cc789d7d4b4eea3b30b24037a254d3788add
Reviewed-on: https://go-review.googlesource.com/21348
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/gc/align.go
src/cmd/compile/internal/gc/bimport.go
src/cmd/compile/internal/gc/plive.go
src/cmd/compile/internal/gc/type.go
src/cmd/compile/internal/gc/typecheck.go