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: "missing function body" detection stops working #48097

Closed
cherrymui opened this issue Aug 31, 2021 · 2 comments
Closed

cmd/compile: "missing function body" detection stops working #48097

cherrymui opened this issue Aug 31, 2021 · 2 comments
Assignees
Labels
Milestone

Comments

@cherrymui
Copy link
Contributor

@cherrymui cherrymui commented Aug 31, 2021

What version of Go are you using (go version)?

tip (bdc1bef)

Does this issue reproduce with the latest release?

No.

What did you do?

Compiling the following code, with a bodyless function but not assembly file or linknames.

package p

func F()

What did you expect to see?

$ go1.17 build x.go
# command-line-arguments
./x.go:3:6: missing function body

What did you see instead?

$ go build x.go
$ go tool compile -complete x.go

No error for both commands. cmd/go does pass -complete to the compiler correctly, but the compiler doesn't detect the error.

cc @mdempsky @aclements @thanm

@cherrymui cherrymui added this to the Go1.18 milestone Aug 31, 2021
@cuonglm
Copy link
Member

@cuonglm cuonglm commented Sep 1, 2021

This seems -G=3 issue, or specifically, irgen since when it also does not handle //go:noescape:

package p

func F()

//go:noescape
func f() {}

Loading

@cuonglm cuonglm self-assigned this Sep 1, 2021
@gopherbot
Copy link

@gopherbot gopherbot commented Sep 1, 2021

Change https://golang.org/cl/346470 mentions this issue: cmd/compile: fix irgen mis-handling invalid function declaration

Loading

@gopherbot gopherbot closed this in 711e1c8 Sep 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants