aboutsummaryrefslogtreecommitdiff
path: root/src/testing/testing.go
diff options
context:
space:
mode:
authorDaniel Martí <mvdan@mvdan.cc>2017-10-10 17:36:03 +0100
committerDaniel Martí <mvdan@mvdan.cc>2017-10-10 17:06:53 +0000
commitf14f7b31416ee655dc588eb3a1772a7a4be2a61c (patch)
treebb17c395fa509a66517b22152c2dab6152937992 /src/testing/testing.go
parentd5a2925b7d8fd947c174967abdd5b5405cc2d53d (diff)
downloadgo-f14f7b31416ee655dc588eb3a1772a7a4be2a61c.tar.xz
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>
Diffstat (limited to 'src/testing/testing.go')
0 files changed, 0 insertions, 0 deletions