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/gc: spurious "constant -1000000000 overflows uintptr" #8060

Closed
dvyukov opened this issue May 21, 2014 · 4 comments
Closed

cmd/gc: spurious "constant -1000000000 overflows uintptr" #8060

dvyukov opened this issue May 21, 2014 · 4 comments
Milestone

Comments

@dvyukov
Copy link
Member

dvyukov commented May 21, 2014

go version devel +4a839bf01b58 Tue May 20 15:52:08 2014 +1000 + linux/amd64

The program is:

package b
var B = []*[2][1]float64{}

package a
import "b"
var X = b.B
func a() {
    _ = [3][1]float64{}
}

$ go build a
a.go:1: constant -1000000000 overflows uintptr

The error is triggered when generating hash function for [2][1]float64 in package a:
# a
before type..hash.[2][1]float64
[SKIP]
.   .   CALLFUNC l(1) tc(1)
.   .   .   NAME-type..hash.[1]float64 u(1) a(1) l(1) x(0+0) class(PFUNC) tc(1) used(1)
FUNC-funcSTRUCT-(FIELD-PTR64-*uintptr, FIELD-uintptr, FIELD-PTR64-*ARRAY-[1]float64)
.   .   CALLFUNC-list
.   .   .   NAME-a.h u(1) a(1) g(1) l(1) x(0+0) class(PPARAM) f(1) tc(1) used(1)
PTR64-*uintptr

.   .   .   LITERAL--1000000000 u(1) a(1) l(1) tc(1) uintptr

.   .   .   ADDR l(1) tc(1) PTR64-*ARRAY-[1]float64
.   .   .   .   INDEX l(1) tc(1) ARRAY-[1]float64
.   .   .   .   .   IND l(1) tc(1) implicit(1) ARRAY-[2]ARRAY-[1]float64
.   .   .   .   .   .   NAME-a.p u(1) a(1) g(3) l(1) x(16+0) class(PPARAM) f(1) tc(1)
used(1) PTR64-*ARRAY-[2]ARRAY-[1]float64
.   .   .   .   .   NAME-a.i u(1) a(1) g(4) l(1) x(0+0) class(PAUTO) f(1) tc(1) used(1)
int


-1000000000 seems to be BADWIDTH.
@rsc
Copy link
Contributor

rsc commented May 21, 2014

Comment 1:

Labels changed: added release-go1.4.

Status changed to Accepted.

@remyoudompheng
Copy link
Contributor

Comment 2:

Status changed to Started.

@gopherbot
Copy link

Comment 3:

CL https://golang.org/cl/110980044 mentions this issue.

@remyoudompheng
Copy link
Contributor

Comment 4:

This issue was closed by revision 8d47b08.

Status changed to Fixed.

@rsc rsc added this to the Go1.4 milestone Apr 14, 2015
@rsc rsc removed the release-go1.4 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
wheatman pushed a commit to wheatman/go-akaros that referenced this issue Jun 25, 2018
Previously it might happen before calling dowidth and
result in a compiler crash.

Fixes golang#8060.

LGTM=dvyukov, rsc
R=golang-codereviews, dvyukov, gobot, rsc
CC=golang-codereviews
https://golang.org/cl/110980044
wheatman pushed a commit to wheatman/go-akaros that referenced this issue Jul 9, 2018
Previously it might happen before calling dowidth and
result in a compiler crash.

Fixes golang#8060.

LGTM=dvyukov, rsc
R=golang-codereviews, dvyukov, gobot, rsc
CC=golang-codereviews
https://golang.org/cl/110980044
wheatman pushed a commit to wheatman/go-akaros that referenced this issue Jul 30, 2018
Previously it might happen before calling dowidth and
result in a compiler crash.

Fixes golang#8060.

LGTM=dvyukov, rsc
R=golang-codereviews, dvyukov, gobot, rsc
CC=golang-codereviews
https://golang.org/cl/110980044
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants