aboutsummaryrefslogtreecommitdiff
path: root/src/syscall/exec_linux_test.go
diff options
context:
space:
mode:
authorMatthew Dempsky <mdempsky@google.com>2019-09-13 15:13:22 -0700
committerMatthew Dempsky <mdempsky@google.com>2019-09-18 01:38:33 +0000
commit1b2c7948963543286516f78f0b0d52956f58d82c (patch)
tree6d34a633bc5640907aaf20216fb27befd1c97170 /src/syscall/exec_linux_test.go
parent04fb929a5b7991ed0945d05ab8015c1721958d82 (diff)
downloadgo-1b2c7948963543286516f78f0b0d52956f58d82c.tar.xz
cmd/compile: tweak OIF construction for binarySearch
When emitting base cases, previously we would emit: if c1 { s1 } if c2 { s2 } if c3 { s3 } With this CL, we instead emit: if c1 { s1 } else if c2 { s2 } else if c3 { s3 } Most of the time, this doesn't make a difference, because s1/s2/s3 are typically "goto" statements. But for type switches, we currently emit: if hash == 271 { if _, ok := iface.(T1); ok { goto t1case } } if hash == 314 { if _, ok := iface.(T2); ok { goto t2case } } That is, the if bodies can fallthrough, even though it's impossible for them to match any of the subsequent cases. Change-Id: I453d424d0b5e40060a703738bbb374523f1c403c Reviewed-on: https://go-review.googlesource.com/c/go/+/195339 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/syscall/exec_linux_test.go')
0 files changed, 0 insertions, 0 deletions