You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What operating system and processor architecture are you using (go env)?
amd64, linux or darwin
The bug can be seen by comparing the source for a cmd/compile/internal/ssa/testdata/hist with its debug log cmd/compile/internal/ssa/testdata/hist.dbg-gdb.nexts (the exact line numbers may change if/when another debugging CL lands).
Source code:
func main() {
hist := make([]int, 10)
var reader io.Reader = strings.NewReader(cannedInput) //gdb-dbg=(hist/A,cannedInput/A)
if len(os.Args) > 1 {
var err error
reader, err = os.Open(os.Args[1])
if err != nil {
fmt.Fprintf(os.Stderr, "There was an error opening %s: %v\n", os.Args[1], err)
return
}
}
scanner := bufio.NewScanner(reader)
Notice the return at line 43. This should not appear, the length of os.Args is zero, and the return is clearly not executed.
Not clear on the cause yet, not sure I'll personally get to this before the 1.10 freeze.
I would attack it by going over ssa.html to figure out where the line number goes wrong
(line numbers now appear there to assist with this sort of debugging)
cd cmd/compile/internal/ssa/testdata
GOSSAFUNC=main go build -gcflags '-N -l' hist.go
The text was updated successfully, but these errors were encountered:
What version of Go are you using (
go version
)?go1.10 devel
Does this issue reproduce with the latest release?
This does not appear in 1.9, but I think this is a new/revealed bug in the line numbering improved by https://go-review.googlesource.com/c/go/+/50610 for #21098.
It appeared after making the very-correct-looking change motivated by this comment
https://go-review.googlesource.com/c/go/+/50610/21/src/cmd/compile/internal/gc/ssa.go#228
What operating system and processor architecture are you using (
go env
)?amd64, linux or darwin
The bug can be seen by comparing the source for a
cmd/compile/internal/ssa/testdata/hist
with its debug logcmd/compile/internal/ssa/testdata/hist.dbg-gdb.nexts
(the exact line numbers may change if/when another debugging CL lands).Source code:
Debugging log:
Notice the return at line 43. This should not appear, the length of os.Args is zero, and the return is clearly not executed.
Not clear on the cause yet, not sure I'll personally get to this before the 1.10 freeze.
I would attack it by going over ssa.html to figure out where the line number goes wrong
(line numbers now appear there to assist with this sort of debugging)
The text was updated successfully, but these errors were encountered: