aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/regexp/exec.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/regexp/exec.go')
-rw-r--r--libgo/go/regexp/exec.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/libgo/go/regexp/exec.go b/libgo/go/regexp/exec.go
index efe764e..4411e4c 100644
--- a/libgo/go/regexp/exec.go
+++ b/libgo/go/regexp/exec.go
@@ -524,6 +524,10 @@ func (re *Regexp) doExecute(r io.RuneReader, b []byte, s string, pos int, ncap i
dstCap = arrayNoInts[:0:0]
}
+ if r == nil && len(b)+len(s) < re.minInputLen {
+ return nil
+ }
+
if re.onepass != nil {
return re.doOnePass(r, b, s, pos, ncap, dstCap)
}