]> Cypherpunks repositories - gostls13.git/commitdiff
regexp: remove unreachable code
authorAlberto Donizetti <alb.donizetti@gmail.com>
Sat, 30 Jan 2016 21:01:00 +0000 (22:01 +0100)
committerBrad Fitzpatrick <bradfitz@golang.org>
Tue, 23 Feb 2016 15:16:50 +0000 (15:16 +0000)
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/19824
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/regexp/backtrack.go

index fd95604fe44a944b86d055f89830fe98e5be319e..3a1100dde8ea6c2ae5e6da3520074afca963366d 100644 (file)
@@ -254,7 +254,6 @@ func (m *machine) tryBacktrack(b *bitState, i input, pc uint32, pos int) bool {
 
                        }
                        panic("bad arg in InstCapture")
-                       continue
 
                case syntax.InstEmptyWidth:
                        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 {
                        // Otherwise, continue on in hope of a longer match.
                        continue
                }
-               panic("unreachable")
        }
 
        return m.matched