Skip to content

Commit

Permalink
encoding/gob: remove always false comparison
Browse files Browse the repository at this point in the history
This is not a functional change. nr is a uint64 and can never be less
than zero, remove the no-op comparison.

Fixes golang#11279

Change-Id: Iebb36cc8fe97428b503e65d01b5e67d2b2bc7369
Reviewed-on: https://go-review.googlesource.com/13876
Run-TryBot: Todd Neal <[email protected]>
Reviewed-by: Brad Fitzpatrick <[email protected]>
TryBot-Result: Gobot Gobot <[email protected]>
  • Loading branch information
tzneal authored and bradfitz committed Aug 25, 2015
1 parent acb4765 commit 7ebaa43
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/encoding/gob/decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ func (dec *Decoder) ignoreSlice(state *decoderState, elemOp decOp) {
func (dec *Decoder) decodeInterface(ityp reflect.Type, state *decoderState, value reflect.Value) {
// Read the name of the concrete type.
nr := state.decodeUint()
if nr < 0 || nr > 1<<31 { // zero is permissible for anonymous types
if nr > 1<<31 { // zero is permissible for anonymous types
errorf("invalid type name length %d", nr)
}
if nr > uint64(state.b.Len()) {
Expand Down

0 comments on commit 7ebaa43

Please sign in to comment.