From af146490bb04205107cb23e301ec7a8ff927b5fc Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Sat, 31 Oct 2015 00:59:47 +0000 Subject: runtime: Remove now unnecessary pad field from ParFor. It is not needed due to the removal of the ctx field. Reviewed-on: https://go-review.googlesource.com/16525 From-SVN: r229616 --- libgo/go/internal/trace/parser_test.go | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 libgo/go/internal/trace/parser_test.go (limited to 'libgo/go/internal/trace/parser_test.go') diff --git a/libgo/go/internal/trace/parser_test.go b/libgo/go/internal/trace/parser_test.go new file mode 100644 index 00000000000..0eeb3e600e4 --- /dev/null +++ b/libgo/go/internal/trace/parser_test.go @@ -0,0 +1,30 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package trace + +import ( + "strings" + "testing" +) + +func TestCorruptedInputs(t *testing.T) { + // These inputs crashed parser previously. + tests := []string{ + "gotrace\x00\x020", + "gotrace\x00Q00\x020", + "gotrace\x00T00\x020", + "gotrace\x00\xc3\x0200", + "go 1.5 trace\x00\x00\x00\x00\x020", + "go 1.5 trace\x00\x00\x00\x00Q00\x020", + "go 1.5 trace\x00\x00\x00\x00T00\x020", + "go 1.5 trace\x00\x00\x00\x00\xc3\x0200", + } + for _, data := range tests { + events, err := Parse(strings.NewReader(data)) + if err == nil || events != nil { + t.Fatalf("no error on input: %q\n", t) + } + } +} -- cgit v1.2.1