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
This is a problem for filenames containing ':' such as in Windows (C:foo/bar.go) - the resulting line numbers will be incorrect (but no error is reported).
https://github.com/golang/go/blob/master/src/cmd/compile/internal/gc/noder.go implements //line pragma parsing now that the old lexer has been replaced.
When splitting //line filename:line into the filename and line part, noder.go looks for the first ':' to make the split: See https://github.com/golang/go/blob/master/src/cmd/compile/internal/gc/noder.go, line 1025, strings.IndexByte.
This is a problem for filenames containing ':' such as in Windows (C:foo/bar.go) - the resulting line numbers will be incorrect (but no error is reported).
The old code looked for the last ':' after "// line ". See e.g., https://github.com/golang/go/blob/adda7ad29551d0880df1805ae22401551b1fbfa8/src/cmd/compile/internal/gc/lex.go, line 961ff., the last ':' position is recorded on line 987 and then used to split the string below (line 997).
This is a regression from 1.7 and should be fixed for 1.8 (fix is trivial).
The text was updated successfully, but these errors were encountered: