From: Daniel Morsing Date: Sat, 2 May 2015 12:08:12 +0000 (+0100) Subject: cmd/pprof/internal/profile: ignore comments when parsing heap profiles X-Git-Tag: go1.5beta1~540 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=19354b9dc87d62dbb5280354be7fd90bdf196a24;p=gostls13.git cmd/pprof/internal/profile: ignore comments when parsing heap profiles Fixes #10659. Change-Id: I22dc306ce6f398dd40010ac430928a718d67d466 Reviewed-on: https://go-review.googlesource.com/9623 Reviewed-by: Russ Cox --- diff --git a/src/cmd/pprof/internal/profile/legacy_profile.go b/src/cmd/pprof/internal/profile/legacy_profile.go index bfc8110e45..e4c92cdd19 100644 --- a/src/cmd/pprof/internal/profile/legacy_profile.go +++ b/src/cmd/pprof/internal/profile/legacy_profile.go @@ -554,9 +554,10 @@ func parseHeap(b []byte) (p *Profile, err error) { } } - if l = strings.TrimSpace(l); l == "" { + if isSpaceOrComment(l) { continue } + l = strings.TrimSpace(l) if sectionTrigger(l) != unrecognizedSection { break