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: assigning to non-1-length array #19671

Closed
ALTree opened this issue Mar 23, 2017 · 4 comments
Closed

cmd/compile: internal compiler error: assigning to non-1-length array #19671

ALTree opened this issue Mar 23, 2017 · 4 comments
Milestone

Comments

@ALTree
Copy link
Member

ALTree commented Mar 23, 2017

The following program:

package a

func Crash() {
	var i int
	arr := [0][2]int{}
	arr[i][0] = 0
}

crashes the 1.7.5, 1.8, and tip compilers.

./2.go:6:12: internal compiler error: assigning to non-1-length array

goroutine 1 [running]:
runtime/debug.Stack(0x0, 0x0, 0x0)
	/home/adonizetti/go/src/runtime/debug/stack.go:24 +0x79
cmd/compile/internal/gc.Fatalf(0xaccca1, 0x1f, 0x0, 0x0, 0x0)
	/home/adonizetti/go/src/cmd/compile/internal/gc/subr.go:175 +0x230
cmd/compile/internal/gc.(*ssafn).Fatalf(0xc4202d8930, 0x60c00000001, 0xaccca1, 0x1f, 0x0, 0x0, 0x0)
	/home/adonizetti/go/src/cmd/compile/internal/gc/ssa.go:4890 +0x67
cmd/compile/internal/gc.(*state).Fatalf(0xc4200f60e0, 0xaccca1, 0x1f, 0x0, 0x0, 0x0)
	/home/adonizetti/go/src/cmd/compile/internal/gc/ssa.go:286 +0x98
cmd/compile/internal/gc.(*state).assign(0xc4200f60e0, 0xc4202f8b40, 0xc42030e1e0, 0x0)
	/home/adonizetti/go/src/cmd/compile/internal/gc/ssa.go:2352 +0x4e6
cmd/compile/internal/gc.(*state).stmt(0xc4200f60e0, 0xc4202f8ab0)
	/home/adonizetti/go/src/cmd/compile/internal/gc/ssa.go:718 +0x246
cmd/compile/internal/gc.(*state).stmtList(0xc4200f60e0, 0xc42030a220)
	/home/adonizetti/go/src/cmd/compile/internal/gc/ssa.go:498 +0x5e
cmd/compile/internal/gc.buildssa(0xc4200b2140, 0x0)
	/home/adonizetti/go/src/cmd/compile/internal/gc/ssa.go:172 +0x873
cmd/compile/internal/gc.compile(0xc4200b2140)
	/home/adonizetti/go/src/cmd/compile/internal/gc/pgen.go:307 +0x177
cmd/compile/internal/gc.funccompile(0xc4200b2140)
	/home/adonizetti/go/src/cmd/compile/internal/gc/dcl.go:1172 +0xbb
cmd/compile/internal/gc.Main(0xad9020)
	/home/adonizetti/go/src/cmd/compile/internal/gc/main.go:511 +0x22f4
main.main()
	/home/adonizetti/go/src/cmd/compile/main.go:49 +0x95
@ianlancetaylor ianlancetaylor added this to the Go1.9 milestone Mar 23, 2017
@ianlancetaylor
Copy link
Contributor

CC @randall77 @josharian @mdempsky

@josharian
Copy link
Contributor

Bisection wanted. :)

@ALTree
Copy link
Member Author

ALTree commented Mar 24, 2017

I was wrong, go1.7.5 is not affected (1.8 and tip are).

This was introduced in 7414450 (cmd/compile: make [0]T and [1]T SSAable types).

@gopherbot
Copy link

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

@golang golang locked and limited conversation to collaborators Mar 24, 2018
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