diff options
Diffstat (limited to 'src/pkg/testing/regexp.go')
-rw-r--r-- | src/pkg/testing/regexp.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/pkg/testing/regexp.go b/src/pkg/testing/regexp.go index e2bde0b25..de30a13f9 100644 --- a/src/pkg/testing/regexp.go +++ b/src/pkg/testing/regexp.go @@ -615,6 +615,9 @@ func CompileRegexp(str string) (regexp *Regexp, error string) { regexp.expr = str regexp.inst = make([]instr, 0, 20) error = regexp.doParse() + if error != nil { + regexp = nil + } return } |