Skip to content

Incorrect line reported in range panic #1856

@mirtchovski

Description

@mirtchovski
Before filing a bug, please check whether it has been fixed since
the latest release: run "hg pull -u" and retry what you did to
reproduce the problem.  Thanks.

What steps will reproduce the problem?
1. Compile the following code:

package main
func main() {
    var x *string
    for _, i := range *x {
        println(i)
    }
}

What is the expected output?

the panic message should contain:
main.main+0x1a /.../t.go:4
    main.main()


What do you see instead?

main.main+0x1a /.../t.go:3
    main.main()


Which compiler are you using (5g, 6g, 8g, gccgo)?

6g (8g does not exhibit this bug)

Which operating system are you using?

Linux and OSX

Which revision are you using?  (hg identify)
561d9021e7a4 tip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions