go/src
Daniel Martí f14f7b3141 cmd/compile: make bad Ctypes be only 0
Before, -1 meant a node being nil or not an OLITERAL, and 0 meant an
OLITERAL missing a Val.

However, the use of this value was confusing and led to some issues,
such as swt.go checking for < 0 instead of <= 0, causing panics.

We never need to differentiate these two cases, so collapse both into 0.
To make it clear that negative values can no longer happen, make Ctype
an uint8.

With this change, we can now get rid of the two n.Type == nil checks
in swt.go added to fix a couple of these panics.

Thanks to Matthew Dempsky for spotting this inconsistency.

Fixes #22001.

Change-Id: I51c65a76f38a3e16788b6a3b57932dad3436dc7e
Reviewed-on: https://go-review.googlesource.com/69510
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-10-10 17:06:53 +00:00
..
archive all: revert "all: prefer strings.LastIndexByte over strings.LastIndex" 2017-10-05 23:19:42 +00:00
bufio
builtin
bytes bytes: panic in ReadFrom with more information with negative Read counts 2017-10-06 06:49:40 +00:00
cmd cmd/compile: make bad Ctypes be only 0 2017-10-10 17:06:53 +00:00
compress compress/bzip2: fix checksum mismatch on empty reads 2017-09-25 23:05:58 +00:00
container container/heap: call t.Helper() in verify() 2017-09-13 17:22:00 +00:00
context context: fix references to "d" in WithDeadline docs 2017-09-21 03:00:51 +00:00
crypto crypto/x509: reject intermediates with unknown critical extensions. 2017-10-10 15:49:01 +00:00
database/sql database/sql: fix unreachable code in ColumnTypes test 2017-10-04 16:30:44 +00:00
debug all: revert "all: prefer strings.LastIndexByte over strings.LastIndex" 2017-10-05 23:19:42 +00:00
encoding encoding/asn1: don't encode strings with '*' as PrintableString. 2017-10-09 19:28:47 +00:00
errors
expvar expvar: make (*Map).Init clear existing keys 2017-09-11 21:31:51 +00:00
flag flag: align multi-line usage strings 2017-09-28 20:45:32 +00:00
fmt fmt: Implement pp.WriteString method 2017-09-20 06:48:34 +00:00
go go/doc: fix constant type propagation 2017-10-09 18:01:14 +00:00
hash
html all: revert "all: prefer strings.IndexByte over strings.Index" 2017-10-05 23:19:10 +00:00
image image/gif: add BenchmarkDecode. 2017-10-07 05:23:42 +00:00
index/suffixarray
internal all: revert "all: prefer strings.LastIndexByte over strings.LastIndex" 2017-10-05 23:19:42 +00:00
io io: Add benchmarks for CopyN 2017-09-20 15:00:31 +00:00
log log: fix data race on log.Output 2017-09-19 20:35:24 +00:00
math math/big: provide support for conversion bases up to 62 2017-10-06 17:46:15 +00:00
mime all: revert "all: prefer strings.IndexByte over strings.Index" 2017-10-05 23:19:10 +00:00
net net/smtp: NewClient: set tls field to true when already using a TLS connection 2017-10-06 03:29:46 +00:00
os all: revert "all: prefer strings.LastIndexByte over strings.LastIndex" 2017-10-05 23:19:42 +00:00
path all: revert "all: prefer strings.LastIndexByte over strings.LastIndex" 2017-10-05 23:19:42 +00:00
plugin runtime, plugin: error not throw on duplicate open 2017-09-09 16:26:33 +00:00
reflect reflect: fix method indexing for non-ASCII exported methods 2017-09-28 18:06:53 +00:00
regexp all: revert "all: prefer strings.IndexByte over strings.Index" 2017-10-05 23:19:10 +00:00
runtime cmd/compile: intrinsify runtime.getcallersp 2017-10-10 15:15:21 +00:00
sort sort: update main example to use Slice along with Sort 2017-09-24 14:40:37 +00:00
strconv all: fix article typos 2017-09-15 02:39:16 +00:00
strings strings: improve readability of IndexAny and LastIndexAny functions. 2017-09-25 18:23:11 +00:00
sync sync/atomic: add memory barriers to Load/StoreInt32 on darwin/arm 2017-10-02 09:57:23 +00:00
syscall syscall: correct TCGETS/TCSETS values on ppc64/ppc64le 2017-09-27 14:53:47 +00:00
testing all: revert "all: prefer strings.LastIndexByte over strings.LastIndex" 2017-10-05 23:19:42 +00:00
text all: use sort.Slice in a few more places 2017-09-22 12:39:14 +00:00
time all: revert "all: prefer strings.LastIndexByte over strings.LastIndex" 2017-10-05 23:19:42 +00:00
unicode all: revert "all: prefer strings.IndexByte over strings.Index" 2017-10-05 23:19:10 +00:00
unsafe
vendor/golang_org/x
Make.dist
all.bash
all.bat
all.rc
androidtest.bash
bootstrap.bash
buildall.bash
clean.bash
clean.bat
clean.rc
cmp.bash
iostest.bash
make.bash
make.bat
make.rc
naclmake.bash
nacltest.bash
race.bash
race.bat
run.bash
run.bat
run.rc