]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: use only bit patterns in isNonNegative
authorJosh Bleecher Snyder <josharian@gmail.com>
Mon, 9 Mar 2020 13:37:49 +0000 (06:37 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Mon, 9 Mar 2020 20:19:25 +0000 (20:19 +0000)
commit5fac45a320561b45b52cdcae933882a70699a21d
treeb82846841f8e3ef2e930ec43fe2acfae8ce0b690
parent3afa86d632859ec61207ce307ba69394e0c7462d
cmd/compile: use only bit patterns in isNonNegative

CL 212777 added a check to isNonNegative
to return true for unsigned values.
However, the SSA backend isn't type safe
enough for that to be sound.
The other checks in isNonNegative
look only at the pattern of bits.
Remove the type-based check.

Updates #37753

Change-Id: I059d0e86353453133f2a160dce53af299f42e533
Reviewed-on: https://go-review.googlesource.com/c/go/+/222620
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
src/cmd/compile/internal/ssa/prove.go
test/fixedbugs/issue37753.go [new file with mode: 0644]