]> Cypherpunks repositories - gostls13.git/commit
cmd/trace: fix a few bugs found by staticcheck
authorDaniel Martí <mvdan@mvdan.cc>
Sun, 20 May 2018 15:02:35 +0000 (16:02 +0100)
committerDaniel Martí <mvdan@mvdan.cc>
Mon, 21 May 2018 16:18:29 +0000 (16:18 +0000)
commit64a832debe1b6bd4002430d65d9447e6e410366e
tree3529500fd9cc2406b6e7563595ce21e046b6d0bd
parenta8e67fe0ed72186c6c5673ed5fab37af0e843393
cmd/trace: fix a few bugs found by staticcheck

First, the regions sort was buggy, as its last comparison was
ineffective.

Second, the insyscall and insyscallRuntime fields were unsigned, so the
check for them being negative was pointless. Make them signed instead,
to also prevent the possibility of underflows when decreasing numbers
that might realistically be 0.

Third, the color constants were all untyped strings except the first
one. Be consistent with their typing.

Change-Id: I4eb8d08028ed92589493c2a4b9cc5a88d83f769b
Reviewed-on: https://go-review.googlesource.com/113895
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/cmd/trace/annotations.go
src/cmd/trace/trace.go