Commit cd41db34 authored by Alberto Donizetti's avatar Alberto Donizetti Committed by Brad Fitzpatrick

regexp: remove unreachable code

Found running go vet on the package. It barks that
	regexp/backtrack.go:257: unreachable code
	regexp/backtrack.go:302: unreachable code

For #11041

Change-Id: I0f5ba0d6183108fba3d144991b826273db0ffb09
Reviewed-on: https://go-review.googlesource.com/19824Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 4ded58bd
...@@ -254,7 +254,6 @@ func (m *machine) tryBacktrack(b *bitState, i input, pc uint32, pos int) bool { ...@@ -254,7 +254,6 @@ func (m *machine) tryBacktrack(b *bitState, i input, pc uint32, pos int) bool {
} }
panic("bad arg in InstCapture") panic("bad arg in InstCapture")
continue
case syntax.InstEmptyWidth: case syntax.InstEmptyWidth:
if syntax.EmptyOp(inst.Arg)&^i.context(pos) != 0 { if syntax.EmptyOp(inst.Arg)&^i.context(pos) != 0 {
...@@ -299,7 +298,6 @@ func (m *machine) tryBacktrack(b *bitState, i input, pc uint32, pos int) bool { ...@@ -299,7 +298,6 @@ func (m *machine) tryBacktrack(b *bitState, i input, pc uint32, pos int) bool {
// Otherwise, continue on in hope of a longer match. // Otherwise, continue on in hope of a longer match.
continue continue
} }
panic("unreachable")
} }
return m.matched return m.matched
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment