]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/pprof/internal/profile: ignore comments when parsing heap profiles
authorDaniel Morsing <daniel.morsing@gmail.com>
Sat, 2 May 2015 12:08:12 +0000 (13:08 +0100)
committerDaniel Morsing <daniel.morsing@gmail.com>
Mon, 18 May 2015 19:36:41 +0000 (19:36 +0000)
Fixes #10659.

Change-Id: I22dc306ce6f398dd40010ac430928a718d67d466
Reviewed-on: https://go-review.googlesource.com/9623
Reviewed-by: Russ Cox <rsc@golang.org>
src/cmd/pprof/internal/profile/legacy_profile.go

index bfc8110e45fcccec7aca6bc081aa066b4dfa8f8e..e4c92cdd1969d22f488bcdc0ae2424dcbaa0edef 100644 (file)
@@ -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