Skip to content

Commit

Permalink
internal/weight/nm: handle _ sym type
Browse files Browse the repository at this point in the history
Fixes #68
  • Loading branch information
egonelbre committed Apr 7, 2023
1 parent 42bd961 commit a616ed5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion internal/weight/nm/measure.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func parseLine(s string) (*Sym, error) {
infoField := ""

isSymType := func(s string) bool {
return len(s) == 1 && unicode.IsLetter(rune(s[0]))
return len(s) == 1 && (unicode.IsLetter(rune(s[0])) || s[0] == '_')
}

switch {
Expand Down
1 change: 1 addition & 0 deletions internal/weight/nm/measure_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ var validLines = []string{
`1091ca0 192 T type:.eq.[2]interface {}`,
`1060160 160 T type:.eq.[2]runtime.Frame`,
`1001fa0 256 T type:.eq.[6]internal/cpu.option`,
` 0 0 _ go.go`,
}

func TestParseLine(t *testing.T) {
Expand Down

0 comments on commit a616ed5

Please sign in to comment.