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: wrong declaration line in debug_info for variables captured in a closure #36542

aarzilli opened this issue Jan 14, 2020 · 2 comments


Copy link

@aarzilli aarzilli commented Jan 14, 2020

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

$ go version
go version devel +f376b8510e Fri Jan 3 01:36:26 2020 +0000 linux/amd64

Does this issue reproduce with the latest release?


What did you do?


package main

import (

func f1(a int) {
	fmt.Printf("a: %d\n", a)

func main() {
	a := 1
	f := func() {

check the DW_AT_decl_line attribute of the variable a in main.main.func1

What did you expect to see?

line 12

What did you see instead?

line 14 (the first use of a inside the closure).

Copy link
Contributor Author

@aarzilli aarzilli commented Jan 14, 2020

Note: this is not a regression.

Copy link

@gopherbot gopherbot commented Jan 14, 2020

Change mentions this issue: cmd/compile: assign correct declaration line to DIE of captured vars

@ALTree ALTree added this to the Backlog milestone Jan 14, 2020
@gopherbot gopherbot closed this in 363cd66 Feb 24, 2020
@golang golang locked and limited conversation to collaborators Feb 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants