diff --git a/internal/weight/nm/measure.go b/internal/weight/nm/measure.go index 80315e4..0517a21 100644 --- a/internal/weight/nm/measure.go +++ b/internal/weight/nm/measure.go @@ -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 { diff --git a/internal/weight/nm/measure_test.go b/internal/weight/nm/measure_test.go index 76eab86..b28fa2a 100644 --- a/internal/weight/nm/measure_test.go +++ b/internal/weight/nm/measure_test.go @@ -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) {