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

Segmentation fault on recursive type #158

Closed
gopherbot opened this issue Nov 13, 2009 · 4 comments
Closed

Segmentation fault on recursive type #158

gopherbot opened this issue Nov 13, 2009 · 4 comments

Comments

@gopherbot
Copy link

by moshevds:

Trying to compile the following code snippet with 6g will reproduce the
segmentation fault:
type A struct {a A}
func foo() {new(A).bar()}
func (a A) bar() {}

Without the method call, 6g correctly reports the invalid recursive type.

As far as I can tell, exportassignok() (go/src/cmd/gc/typecheck.c) gets
caught up in an endless recursion.

The bug also surfaces when chaining 2 or more types together.

Some other information:
GOARCH=amd64
GOBIN=~/bin
GOOS=linux
GOROOT=~/go
I'm at changeset 4031:b2ccee5ff169
@agl
Copy link
Contributor

agl commented Nov 13, 2009

Comment 1:

Status changed to Accepted.

@rsc
Copy link
Contributor

rsc commented Nov 15, 2009

Comment 2:

Owner changed to r...@golang.org.

@rsc
Copy link
Contributor

rsc commented Nov 15, 2009

Comment 3:

Status changed to Started.

@rsc
Copy link
Contributor

rsc commented Nov 15, 2009

Comment 4:

This issue was closed by revision a338231.

Status changed to Fixed.

Merged into issue #-.

@golang golang locked and limited conversation to collaborators Jun 24, 2016
@rsc rsc removed their assignment Jun 22, 2022
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

3 participants