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
if !path.IsAbs(name) {
if dirIndex >= len(r.directories) {
return false, DecodeError{"line", off, "directory index too large"}
}
name = path.Join(r.directories[dirIndex], name)
}
We can't use filepath, because we want the processing to be the same on all systems (Windows should be able to process Unix path names correctly, and vice versa). But path isn't right for Windows paths.
In the cmd/link/dwarf_test.go tests, this code runs with r.directories[dirIndex] being C:\workdir\go\src\cmd\link and name being C:/workdir/go/src/runtime/testdata/testprogcgo/main.go. path.IsAbs reports that the latter is not absolute, and then path.Join puts them together as
which is unfortunate. Probably we need to have dwarf know that something beginning with [A-Z]:[/\\] is an absolute path.
For now I will change the DWARF test (checking that line number information is present at all) not to notice this problem, so that the more important fix can be cherry-picked cleanly into Go 1.8.1.
src/debug/dwarf/line.go's readFileEntry does:
We can't use filepath, because we want the processing to be the same on all systems (Windows should be able to process Unix path names correctly, and vice versa). But path isn't right for Windows paths.
In the cmd/link/dwarf_test.go tests, this code runs with r.directories[dirIndex] being C:\workdir\go\src\cmd\link and name being C:/workdir/go/src/runtime/testdata/testprogcgo/main.go. path.IsAbs reports that the latter is not absolute, and then path.Join puts them together as
which is unfortunate. Probably we need to have dwarf know that something beginning with
[A-Z]:[/\\]
is an absolute path.For now I will change the DWARF test (checking that line number information is present at all) not to notice this problem, so that the more important fix can be cherry-picked cleanly into Go 1.8.1.
/cc @aclements
The text was updated successfully, but these errors were encountered: