Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/compile: internal compiler error: out of range for go.shape.int64 [1.20 backport] #60675

Closed
gopherbot opened this issue Jun 8, 2023 · 2 comments
Labels
CherryPickApproved Used during the release process for point releases compiler/runtime Issues related to the Go compiler and/or runtime.
Milestone

Comments

@gopherbot
Copy link

@cuonglm requested issue #60601 to be considered for backport to the next 1.20 minor release.

@gopherbot please backport this issue to go1.20, it's a compiler crash for legal user code.

@gopherbot gopherbot added the CherryPickCandidate Used during the release process for point releases label Jun 8, 2023
@gopherbot gopherbot added this to the Go1.20.6 milestone Jun 8, 2023
@dmitshur dmitshur changed the title internal compiler error: out of range for go.shape.int64 [1.20 backport] cmd/compile: internal compiler error: out of range for go.shape.int64 [1.20 backport] Jun 8, 2023
@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Jun 8, 2023
@prattmic prattmic added the CherryPickApproved Used during the release process for point releases label Jun 14, 2023
@gopherbot gopherbot removed the CherryPickCandidate Used during the release process for point releases label Jun 14, 2023
@gopherbot
Copy link
Author

Change https://go.dev/cl/503855 mentions this issue: [release-branch.go1.20] cmd/compile: do not report division by error during typecheck

@gopherbot
Copy link
Author

Closed by merging 63ad2b5 to release-branch.go1.20.

gopherbot pushed a commit that referenced this issue Jun 19, 2023
…during typecheck

types2 have already errored about any spec-required overflows, and
division by zero. CL 469595 unintentionally fixed typecheck not to error
about overflows, but zero division is still be checked during tcArith.
This causes unsafe operations with variable size failed to compile,
instead of raising runtime error.

This CL also making change to typecheck.EvalConst, to stop evaluating
literal shifts or binary operators where {over,under}flows can happen.
For go1.21, typecheck.EvalConst is removed entirely, but that change is
too large to backport.

See discussion in CL 501735 for more details.

Fixes #60675

Change-Id: I7bea2821099556835c920713397f7c5d8a4025ac
Reviewed-on: https://go-review.googlesource.com/c/go/+/501735
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/503855
Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CherryPickApproved Used during the release process for point releases compiler/runtime Issues related to the Go compiler and/or runtime.
Projects
None yet
Development

No branches or pull requests

2 participants