-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Closed
Labels
AnalysisIssues related to static analysis (vet, x/tools/go/analysis)Issues related to static analysis (vet, x/tools/go/analysis)FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.ToolsThis label describes issues relating to any tools in the x/tools repository.This label describes issues relating to any tools in the x/tools repository.
Milestone
Description
Input:
package main
func foo(x int) { _ = 1 << x }
func main() { foo(-1) }
Output:
func foo(x int):
0: entry P:0 S:0
t0 = convert uint64 <- int (x) uint64
t1 = 1:int << t0 int
return
Actual runtime behavior:
$ go run bar.go
panic: runtime error: negative shift amount
This issue is very similar to #50949, with much of the same possible fixes.
/cc @timothy-king
Metadata
Metadata
Assignees
Labels
AnalysisIssues related to static analysis (vet, x/tools/go/analysis)Issues related to static analysis (vet, x/tools/go/analysis)FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.ToolsThis label describes issues relating to any tools in the x/tools repository.This label describes issues relating to any tools in the x/tools repository.