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/regexp/all_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'libgo/go/regexp/all_test.go') diff --git a/libgo/go/regexp/all_test.go b/libgo/go/regexp/all_test.go index 01ea374..d78ae6a 100644 --- a/libgo/go/regexp/all_test.go +++ b/libgo/go/regexp/all_test.go @@ -489,6 +489,17 @@ func TestOnePassCutoff(t *testing.T) { } } +// Check that the same machine can be used with the standard matcher +// and then the backtracker when there are no captures. +func TestSwitchBacktrack(t *testing.T) { + re := MustCompile(`a|b`) + long := make([]byte, maxBacktrackVector+1) + + // The following sequence of Match calls used to panic. See issue #10319. + re.Match(long) // triggers standard matcher + re.Match(long[:1]) // triggers backtracker +} + func BenchmarkLiteral(b *testing.B) { x := strings.Repeat("x", 50) + "y" b.StopTimer() -- cgit v1.1