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
package main
import (
"go/parser"
)
funcmain() {
// This file must exist, or you get an `open` error before the issue happens._, _=parser.ParseFile(nil, "foo.go", nil, 0)
panic("Aha!")
}
What did you expect to see?
A panic
What did you see instead?
The program terminates with no output.
After putting this through gdb, there's a segfault happening because the first parameter I am passing in to parser.ParseFile is nil. This surprises me in two ways: firstly, I generally expect to see "Program terminated due to SIGSEGV" or something when there's a segfault, without needing to resort to a debugger; and secondly the documentation doesn't say that this is invalid.
The text was updated successfully, but these errors were encountered:
Please answer these questions before submitting your issue. Thanks!
go version
)?go version go1.6.2 darwin/amd64
go env
)?A panic
The program terminates with no output.
After putting this through gdb, there's a segfault happening because the first parameter I am passing in to
parser.ParseFile
isnil
. This surprises me in two ways: firstly, I generally expect to see "Program terminated due to SIGSEGV" or something when there's a segfault, without needing to resort to a debugger; and secondly the documentation doesn't say that this is invalid.The text was updated successfully, but these errors were encountered: