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

Comments

Projects
None yet
4 participants
@ALTree
Copy link
Member

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

This comment has been minimized.

Copy link
Contributor

commented Mar 23, 2017

@josharian

This comment has been minimized.

Copy link
Contributor

commented Mar 23, 2017

Bisection wanted. :)

@ALTree

This comment has been minimized.

Copy link
Member Author

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

This comment has been minimized.

Copy link

commented Mar 24, 2017

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

@gopherbot gopherbot closed this in 7202341 Mar 24, 2017

@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.
You can’t perform that action at this time.