Commit de3ef2c0 authored by Kirill Smelkov's avatar Kirill Smelkov

X neo/protogen/decode: Help compiler to elmiminate bounds checks by explicitly specifying :hi

See https://github.com/golang/go/issues/19126#issuecomment-358743715.

Examples:

		before										after

TEXT ·(*GetObject).neoMsgDecode(SB), NOSPLIT, $8-56 // zproto-marshal.go:1914   │TEXT ·(*GetObject).neoMsgDecode(SB), NOSPLIT, $0-56 // zproto-marshal.go:1914
        // SUBQ    $8, SP                                                       │        NO_LOCAL_POINTERS
        // MOVQ    BP, (SP) (BP save)                                           │        // FUNCDATA $0, gclocals·846769608458630ae82546dab39e913e(SB) (args)
        // LEAQ    (SP), BP (BP init)                                           │        // FUNCDATA $1, gclocals·33cdeccccebe80329f1fdbee7f5874cb(SB) (no locals)
        // FUNCDATA $0, gclocals·21e863e2261befa92f8534560680bbb6(SB) (args)    │        MOVQ       data+24(SP), AX
        FUNCDATA   $1, gclocals·69c1753bd5f81501d95132d08af04464(SB) (locals)   │        CMPQ       AX, $24                        // zproto-marshal.go:1915
        MOVQ       data+32(SP), AX                                              │        JGE        pc45
        CMPQ       AX, $24                      // zproto-marshal.go:1915       │        MOVQ       ·ErrDecodeOverflow+8(SB), AX  // zproto-marshal.go:1924
        JLT        pc163                                                        │        MOVQ       ·ErrDecodeOverflow(SB), CX
        MOVQ       data+24(SP), CX                                              │        MOVQ       $0, _r1+40(SP)
        MOVQ       (CX), DX                     // zproto-marshal.go:1918       │        MOVQ       CX, _r2+48(SP)
        BSWAPQ     DX                                                           │        MOVQ       AX, _r2+56(SP)
        MOVQ       p+16(SP), BX                                                 │        RET
        MOVQ       DX, (BX)                                                     │pc45:
        LEAQ       -8(AX), DX                   // zproto-marshal.go:1919       │        MOVQ       data+16(SP), AX
        MOVQ       data+40(SP), SI                                              │        MOVQ       (AX), CX                       // zproto-marshal.go:1918
        LEAQ       -8(SI), DI                                                   │        BSWAPQ     CX
        NEGQ       DI                                                           │        MOVQ       p+8(SP), DX
        SARQ       $63, DI                                                      │        MOVQ       CX, (DX)
        ANDQ       $8, DI                                                       │        MOVQ       8(AX), CX                      // zproto-marshal.go:1919
        CMPQ       DX, $7                                                       │        BSWAPQ     CX
        JLS        pc212                                                        │        MOVQ       CX, 8(DX)
        MOVQ       (CX)(DI*1), DX                                               │        MOVQ       16(AX), AX                     // zproto-marshal.go:1920
        BSWAPQ     DX                                                           │        BSWAPQ     AX
        MOVQ       DX, 8(BX)                                                    │        MOVQ       AX, 16(DX)
        LEAQ       -16(SI), DX                  // zproto-marshal.go:1920       │        MOVQ       $24, _r1+40(SP)                // zproto-marshal.go:1921
        NEGQ       DX                                                           │        MOVQ       $0, _r2+48(SP)
        ADDQ       $-16, AX                                                     │        MOVQ       $0, _r2+56(SP)
        SARQ       $63, DX                                                      │        RET
        ANDQ       $16, DX                                                      │
        CMPQ       AX, $7                                                       │
        JLS        pc205                                                        │
        MOVQ       (CX)(DX*1), AX                                               │
        BSWAPQ     AX                                                           │
        MOVQ       AX, 16(BX)                                                   │
        MOVQ       $24, _r1+48(SP)              // zproto-marshal.go:1921       │
        MOVQ       $0, _r2+56(SP)                                               │
        MOVQ       $0, _r2+64(SP)                                               │
        // MOVQ    (SP), BP (BP restore)                                        │
        // ADDQ    $8, SP (SP restore)                                          │
        RET                                                                     │
pc163:                                                                          │
        MOVQ       ·ErrDecodeOverflow(SB), AX  // zproto-marshal.go:1924        │
        MOVQ       ·ErrDecodeOverflow+8(SB), CX                                 │
        MOVQ       $0, _r1+48(SP)                                               │
        MOVQ       AX, _r2+56(SP)                                               │
        MOVQ       CX, _r2+64(SP)                                               │
        // MOVQ    (SP), BP (BP restore)                                        │
        // ADDQ    $8, SP (SP restore)                                          │
        RET                                                                     │
pc205:                                                                          │
        PCDATA     $0, $1                       // zproto-marshal.go:1920       │
        CALL       runtime.panicindex(SB)                                       │
        UNDEF                                                                   │
pc212:                                                                          │
        PCDATA     $0, $1                       // zproto-marshal.go:1919       │
        CALL       runtime.panicindex(SB)                                       │
        UNDEF                                                                   │
parent 0f7e0b00
...@@ -869,7 +869,11 @@ func (e *encoder) genBasic(path string, typ *types.Basic, userType types.Type) { ...@@ -869,7 +869,11 @@ func (e *encoder) genBasic(path string, typ *types.Basic, userType types.Type) {
func (d *decoder) genBasic(assignto string, typ *types.Basic, userType types.Type) { func (d *decoder) genBasic(assignto string, typ *types.Basic, userType types.Type) {
basic := basicTypes[typ.Kind()] basic := basicTypes[typ.Kind()]
dataptr := fmt.Sprintf("data[%v:]", d.n)
// XXX specifying :hi is not needed - it is only a workaround to help BCE.
// see https://github.com/golang/go/issues/19126#issuecomment-358743715
dataptr := fmt.Sprintf("data[%v:%v+%d]", d.n, d.n, basic.wireSize)
decoded := fmt.Sprintf(basic.decode, dataptr) decoded := fmt.Sprintf(basic.decode, dataptr)
if userType != typ && userType != nil { if userType != typ && userType != nil {
// need to cast (like in encode case) // need to cast (like in encode case)
......
...@@ -41,9 +41,9 @@ func (p *Error) neoMsgDecode(data []byte) (int, error) { ...@@ -41,9 +41,9 @@ func (p *Error) neoMsgDecode(data []byte) (int, error) {
if len(data) < 8 { if len(data) < 8 {
goto overflow goto overflow
} }
p.Code = ErrorCode(binary.BigEndian.Uint32(data[0:])) p.Code = ErrorCode(binary.BigEndian.Uint32(data[0 : 0+4]))
{ {
l := binary.BigEndian.Uint32(data[4:]) l := binary.BigEndian.Uint32(data[4 : 4+4])
data = data[8:] data = data[8:]
if uint64(len(data)) < uint64(l) { if uint64(len(data)) < uint64(l) {
goto overflow goto overflow
...@@ -93,8 +93,8 @@ func (p *RequestIdentification) neoMsgDecode(data []byte) (int, error) { ...@@ -93,8 +93,8 @@ func (p *RequestIdentification) neoMsgDecode(data []byte) (int, error) {
if len(data) < 8 { if len(data) < 8 {
goto overflow goto overflow
} }
p.NodeType = NodeType(int32(binary.BigEndian.Uint32(data[0:]))) p.NodeType = NodeType(int32(binary.BigEndian.Uint32(data[0 : 0+4])))
p.UUID = NodeUUID(int32(binary.BigEndian.Uint32(data[4:]))) p.UUID = NodeUUID(int32(binary.BigEndian.Uint32(data[4 : 4+4])))
data = data[8:] data = data[8:]
{ {
n, ok := p.Address.neoDecode(data) n, ok := p.Address.neoDecode(data)
...@@ -108,7 +108,7 @@ func (p *RequestIdentification) neoMsgDecode(data []byte) (int, error) { ...@@ -108,7 +108,7 @@ func (p *RequestIdentification) neoMsgDecode(data []byte) (int, error) {
goto overflow goto overflow
} }
{ {
l := binary.BigEndian.Uint32(data[0:]) l := binary.BigEndian.Uint32(data[0 : 0+4])
data = data[4:] data = data[4:]
if uint64(len(data)) < uint64(l) { if uint64(len(data)) < uint64(l) {
goto overflow goto overflow
...@@ -153,11 +153,11 @@ func (p *AcceptIdentification) neoMsgDecode(data []byte) (int, error) { ...@@ -153,11 +153,11 @@ func (p *AcceptIdentification) neoMsgDecode(data []byte) (int, error) {
if len(data) < 20 { if len(data) < 20 {
goto overflow goto overflow
} }
p.NodeType = NodeType(int32(binary.BigEndian.Uint32(data[0:]))) p.NodeType = NodeType(int32(binary.BigEndian.Uint32(data[0 : 0+4])))
p.MyUUID = NodeUUID(int32(binary.BigEndian.Uint32(data[4:]))) p.MyUUID = NodeUUID(int32(binary.BigEndian.Uint32(data[4 : 4+4])))
p.NumPartitions = binary.BigEndian.Uint32(data[8:]) p.NumPartitions = binary.BigEndian.Uint32(data[8 : 8+4])
p.NumReplicas = binary.BigEndian.Uint32(data[12:]) p.NumReplicas = binary.BigEndian.Uint32(data[12 : 12+4])
p.YourUUID = NodeUUID(int32(binary.BigEndian.Uint32(data[16:]))) p.YourUUID = NodeUUID(int32(binary.BigEndian.Uint32(data[16 : 16+4])))
return 20, nil return 20, nil
overflow: overflow:
...@@ -250,7 +250,7 @@ func (p *AnswerPrimary) neoMsgDecode(data []byte) (int, error) { ...@@ -250,7 +250,7 @@ func (p *AnswerPrimary) neoMsgDecode(data []byte) (int, error) {
if len(data) < 4 { if len(data) < 4 {
goto overflow goto overflow
} }
p.PrimaryNodeUUID = NodeUUID(int32(binary.BigEndian.Uint32(data[0:]))) p.PrimaryNodeUUID = NodeUUID(int32(binary.BigEndian.Uint32(data[0 : 0+4])))
return 4, nil return 4, nil
overflow: overflow:
...@@ -294,9 +294,9 @@ func (p *NotPrimaryMaster) neoMsgDecode(data []byte) (int, error) { ...@@ -294,9 +294,9 @@ func (p *NotPrimaryMaster) neoMsgDecode(data []byte) (int, error) {
if len(data) < 8 { if len(data) < 8 {
goto overflow goto overflow
} }
p.Primary = NodeUUID(int32(binary.BigEndian.Uint32(data[0:]))) p.Primary = NodeUUID(int32(binary.BigEndian.Uint32(data[0 : 0+4])))
{ {
l := binary.BigEndian.Uint32(data[4:]) l := binary.BigEndian.Uint32(data[4 : 4+4])
data = data[8:] data = data[8:]
p.KnownMasterList = make([]struct{ Address }, l) p.KnownMasterList = make([]struct{ Address }, l)
for i := 0; uint32(i) < l; i++ { for i := 0; uint32(i) < l; i++ {
...@@ -373,7 +373,7 @@ func (p *NotifyNodeInformation) neoMsgDecode(data []byte) (int, error) { ...@@ -373,7 +373,7 @@ func (p *NotifyNodeInformation) neoMsgDecode(data []byte) (int, error) {
goto overflow goto overflow
} }
{ {
l := binary.BigEndian.Uint32(data[0:]) l := binary.BigEndian.Uint32(data[0 : 0+4])
data = data[4:] data = data[4:]
p.NodeList = make([]NodeInfo, l) p.NodeList = make([]NodeInfo, l)
for i := 0; uint32(i) < l; i++ { for i := 0; uint32(i) < l; i++ {
...@@ -381,7 +381,7 @@ func (p *NotifyNodeInformation) neoMsgDecode(data []byte) (int, error) { ...@@ -381,7 +381,7 @@ func (p *NotifyNodeInformation) neoMsgDecode(data []byte) (int, error) {
if len(data) < 4 { if len(data) < 4 {
goto overflow goto overflow
} }
(*a).Type = NodeType(int32(binary.BigEndian.Uint32(data[0:]))) (*a).Type = NodeType(int32(binary.BigEndian.Uint32(data[0 : 0+4])))
data = data[4:] data = data[4:]
{ {
n, ok := (*a).Addr.neoDecode(data) n, ok := (*a).Addr.neoDecode(data)
...@@ -394,8 +394,8 @@ func (p *NotifyNodeInformation) neoMsgDecode(data []byte) (int, error) { ...@@ -394,8 +394,8 @@ func (p *NotifyNodeInformation) neoMsgDecode(data []byte) (int, error) {
if len(data) < 8 { if len(data) < 8 {
goto overflow goto overflow
} }
(*a).UUID = NodeUUID(int32(binary.BigEndian.Uint32(data[0:]))) (*a).UUID = NodeUUID(int32(binary.BigEndian.Uint32(data[0 : 0+4])))
(*a).State = NodeState(int32(binary.BigEndian.Uint32(data[4:]))) (*a).State = NodeState(int32(binary.BigEndian.Uint32(data[4 : 4+4])))
data = data[8:] data = data[8:]
{ {
n, ok := (*a).IdTime.neoDecode(data) n, ok := (*a).IdTime.neoDecode(data)
...@@ -451,9 +451,9 @@ func (p *AnswerRecovery) neoMsgDecode(data []byte) (int, error) { ...@@ -451,9 +451,9 @@ func (p *AnswerRecovery) neoMsgDecode(data []byte) (int, error) {
if len(data) < 24 { if len(data) < 24 {
goto overflow goto overflow
} }
p.PTid = PTid(binary.BigEndian.Uint64(data[0:])) p.PTid = PTid(binary.BigEndian.Uint64(data[0 : 0+8]))
p.BackupTid = zodb.Tid(binary.BigEndian.Uint64(data[8:])) p.BackupTid = zodb.Tid(binary.BigEndian.Uint64(data[8 : 8+8]))
p.TruncateTid = zodb.Tid(binary.BigEndian.Uint64(data[16:])) p.TruncateTid = zodb.Tid(binary.BigEndian.Uint64(data[16 : 16+8]))
return 24, nil return 24, nil
overflow: overflow:
...@@ -496,8 +496,8 @@ func (p *AnswerLastIDs) neoMsgDecode(data []byte) (int, error) { ...@@ -496,8 +496,8 @@ func (p *AnswerLastIDs) neoMsgDecode(data []byte) (int, error) {
if len(data) < 16 { if len(data) < 16 {
goto overflow goto overflow
} }
p.LastOid = zodb.Oid(binary.BigEndian.Uint64(data[0:])) p.LastOid = zodb.Oid(binary.BigEndian.Uint64(data[0 : 0+8]))
p.LastTid = zodb.Tid(binary.BigEndian.Uint64(data[8:])) p.LastTid = zodb.Tid(binary.BigEndian.Uint64(data[8 : 8+8]))
return 16, nil return 16, nil
overflow: overflow:
...@@ -566,9 +566,9 @@ func (p *AnswerPartitionTable) neoMsgDecode(data []byte) (int, error) { ...@@ -566,9 +566,9 @@ func (p *AnswerPartitionTable) neoMsgDecode(data []byte) (int, error) {
if len(data) < 12 { if len(data) < 12 {
goto overflow goto overflow
} }
p.PTid = PTid(binary.BigEndian.Uint64(data[0:])) p.PTid = PTid(binary.BigEndian.Uint64(data[0 : 0+8]))
{ {
l := binary.BigEndian.Uint32(data[8:]) l := binary.BigEndian.Uint32(data[8 : 8+4])
data = data[12:] data = data[12:]
p.RowList = make([]RowInfo, l) p.RowList = make([]RowInfo, l)
for i := 0; uint32(i) < l; i++ { for i := 0; uint32(i) < l; i++ {
...@@ -576,9 +576,9 @@ func (p *AnswerPartitionTable) neoMsgDecode(data []byte) (int, error) { ...@@ -576,9 +576,9 @@ func (p *AnswerPartitionTable) neoMsgDecode(data []byte) (int, error) {
if len(data) < 8 { if len(data) < 8 {
goto overflow goto overflow
} }
(*a).Offset = binary.BigEndian.Uint32(data[0:]) (*a).Offset = binary.BigEndian.Uint32(data[0 : 0+4])
{ {
l := binary.BigEndian.Uint32(data[4:]) l := binary.BigEndian.Uint32(data[4 : 4+4])
data = data[8:] data = data[8:]
if uint64(len(data)) < uint64(l)*8 { if uint64(len(data)) < uint64(l)*8 {
goto overflow goto overflow
...@@ -587,8 +587,8 @@ func (p *AnswerPartitionTable) neoMsgDecode(data []byte) (int, error) { ...@@ -587,8 +587,8 @@ func (p *AnswerPartitionTable) neoMsgDecode(data []byte) (int, error) {
(*a).CellList = make([]CellInfo, l) (*a).CellList = make([]CellInfo, l)
for i := 0; uint32(i) < l; i++ { for i := 0; uint32(i) < l; i++ {
a := &(*a).CellList[i] a := &(*a).CellList[i]
(*a).UUID = NodeUUID(int32(binary.BigEndian.Uint32(data[0:]))) (*a).UUID = NodeUUID(int32(binary.BigEndian.Uint32(data[0 : 0+4])))
(*a).State = CellState(int32(binary.BigEndian.Uint32(data[4:]))) (*a).State = CellState(int32(binary.BigEndian.Uint32(data[4 : 4+4])))
data = data[8:] data = data[8:]
} }
} }
...@@ -646,9 +646,9 @@ func (p *SendPartitionTable) neoMsgDecode(data []byte) (int, error) { ...@@ -646,9 +646,9 @@ func (p *SendPartitionTable) neoMsgDecode(data []byte) (int, error) {
if len(data) < 12 { if len(data) < 12 {
goto overflow goto overflow
} }
p.PTid = PTid(binary.BigEndian.Uint64(data[0:])) p.PTid = PTid(binary.BigEndian.Uint64(data[0 : 0+8]))
{ {
l := binary.BigEndian.Uint32(data[8:]) l := binary.BigEndian.Uint32(data[8 : 8+4])
data = data[12:] data = data[12:]
p.RowList = make([]RowInfo, l) p.RowList = make([]RowInfo, l)
for i := 0; uint32(i) < l; i++ { for i := 0; uint32(i) < l; i++ {
...@@ -656,9 +656,9 @@ func (p *SendPartitionTable) neoMsgDecode(data []byte) (int, error) { ...@@ -656,9 +656,9 @@ func (p *SendPartitionTable) neoMsgDecode(data []byte) (int, error) {
if len(data) < 8 { if len(data) < 8 {
goto overflow goto overflow
} }
(*a).Offset = binary.BigEndian.Uint32(data[0:]) (*a).Offset = binary.BigEndian.Uint32(data[0 : 0+4])
{ {
l := binary.BigEndian.Uint32(data[4:]) l := binary.BigEndian.Uint32(data[4 : 4+4])
data = data[8:] data = data[8:]
if uint64(len(data)) < uint64(l)*8 { if uint64(len(data)) < uint64(l)*8 {
goto overflow goto overflow
...@@ -667,8 +667,8 @@ func (p *SendPartitionTable) neoMsgDecode(data []byte) (int, error) { ...@@ -667,8 +667,8 @@ func (p *SendPartitionTable) neoMsgDecode(data []byte) (int, error) {
(*a).CellList = make([]CellInfo, l) (*a).CellList = make([]CellInfo, l)
for i := 0; uint32(i) < l; i++ { for i := 0; uint32(i) < l; i++ {
a := &(*a).CellList[i] a := &(*a).CellList[i]
(*a).UUID = NodeUUID(int32(binary.BigEndian.Uint32(data[0:]))) (*a).UUID = NodeUUID(int32(binary.BigEndian.Uint32(data[0 : 0+4])))
(*a).State = CellState(int32(binary.BigEndian.Uint32(data[4:]))) (*a).State = CellState(int32(binary.BigEndian.Uint32(data[4 : 4+4])))
data = data[8:] data = data[8:]
} }
} }
...@@ -712,9 +712,9 @@ func (p *NotifyPartitionChanges) neoMsgDecode(data []byte) (int, error) { ...@@ -712,9 +712,9 @@ func (p *NotifyPartitionChanges) neoMsgDecode(data []byte) (int, error) {
if len(data) < 12 { if len(data) < 12 {
goto overflow goto overflow
} }
p.PTid = PTid(binary.BigEndian.Uint64(data[0:])) p.PTid = PTid(binary.BigEndian.Uint64(data[0 : 0+8]))
{ {
l := binary.BigEndian.Uint32(data[8:]) l := binary.BigEndian.Uint32(data[8 : 8+4])
data = data[12:] data = data[12:]
if uint64(len(data)) < uint64(l)*12 { if uint64(len(data)) < uint64(l)*12 {
goto overflow goto overflow
...@@ -726,9 +726,9 @@ func (p *NotifyPartitionChanges) neoMsgDecode(data []byte) (int, error) { ...@@ -726,9 +726,9 @@ func (p *NotifyPartitionChanges) neoMsgDecode(data []byte) (int, error) {
}, l) }, l)
for i := 0; uint32(i) < l; i++ { for i := 0; uint32(i) < l; i++ {
a := &p.CellList[i] a := &p.CellList[i]
(*a).Offset = binary.BigEndian.Uint32(data[0:]) (*a).Offset = binary.BigEndian.Uint32(data[0 : 0+4])
(*a).CellInfo.UUID = NodeUUID(int32(binary.BigEndian.Uint32(data[4:]))) (*a).CellInfo.UUID = NodeUUID(int32(binary.BigEndian.Uint32(data[4 : 4+4])))
(*a).CellInfo.State = CellState(int32(binary.BigEndian.Uint32(data[8:]))) (*a).CellInfo.State = CellState(int32(binary.BigEndian.Uint32(data[8 : 8+4])))
data = data[12:] data = data[12:]
} }
} }
...@@ -756,7 +756,7 @@ func (p *StartOperation) neoMsgDecode(data []byte) (int, error) { ...@@ -756,7 +756,7 @@ func (p *StartOperation) neoMsgDecode(data []byte) (int, error) {
if len(data) < 1 { if len(data) < 1 {
goto overflow goto overflow
} }
p.Backup = byte2bool((data[0:])[0]) p.Backup = byte2bool((data[0 : 0+1])[0])
return 1, nil return 1, nil
overflow: overflow:
...@@ -809,7 +809,7 @@ func (p *UnfinishedTransactions) neoMsgDecode(data []byte) (int, error) { ...@@ -809,7 +809,7 @@ func (p *UnfinishedTransactions) neoMsgDecode(data []byte) (int, error) {
goto overflow goto overflow
} }
{ {
l := binary.BigEndian.Uint32(data[0:]) l := binary.BigEndian.Uint32(data[0 : 0+4])
data = data[4:] data = data[4:]
if uint64(len(data)) < uint64(l)*4 { if uint64(len(data)) < uint64(l)*4 {
goto overflow goto overflow
...@@ -818,7 +818,7 @@ func (p *UnfinishedTransactions) neoMsgDecode(data []byte) (int, error) { ...@@ -818,7 +818,7 @@ func (p *UnfinishedTransactions) neoMsgDecode(data []byte) (int, error) {
p.RowList = make([]struct{ Offset uint32 }, l) p.RowList = make([]struct{ Offset uint32 }, l)
for i := 0; uint32(i) < l; i++ { for i := 0; uint32(i) < l; i++ {
a := &p.RowList[i] a := &p.RowList[i]
(*a).Offset = binary.BigEndian.Uint32(data[0:]) (*a).Offset = binary.BigEndian.Uint32(data[0 : 0+4])
data = data[4:] data = data[4:]
} }
} }
...@@ -857,9 +857,9 @@ func (p *AnswerUnfinishedTransactions) neoMsgDecode(data []byte) (int, error) { ...@@ -857,9 +857,9 @@ func (p *AnswerUnfinishedTransactions) neoMsgDecode(data []byte) (int, error) {
if len(data) < 12 { if len(data) < 12 {
goto overflow goto overflow
} }
p.MaxTID = zodb.Tid(binary.BigEndian.Uint64(data[0:])) p.MaxTID = zodb.Tid(binary.BigEndian.Uint64(data[0 : 0+8]))
{ {
l := binary.BigEndian.Uint32(data[8:]) l := binary.BigEndian.Uint32(data[8 : 8+4])
data = data[12:] data = data[12:]
if uint64(len(data)) < uint64(l)*8 { if uint64(len(data)) < uint64(l)*8 {
goto overflow goto overflow
...@@ -868,7 +868,7 @@ func (p *AnswerUnfinishedTransactions) neoMsgDecode(data []byte) (int, error) { ...@@ -868,7 +868,7 @@ func (p *AnswerUnfinishedTransactions) neoMsgDecode(data []byte) (int, error) {
p.TidList = make([]struct{ UnfinishedTID zodb.Tid }, l) p.TidList = make([]struct{ UnfinishedTID zodb.Tid }, l)
for i := 0; uint32(i) < l; i++ { for i := 0; uint32(i) < l; i++ {
a := &p.TidList[i] a := &p.TidList[i]
(*a).UnfinishedTID = zodb.Tid(binary.BigEndian.Uint64(data[0:])) (*a).UnfinishedTID = zodb.Tid(binary.BigEndian.Uint64(data[0 : 0+8]))
data = data[8:] data = data[8:]
} }
} }
...@@ -929,7 +929,7 @@ func (p *AnswerLockedTransactions) neoMsgDecode(data []byte) (int, error) { ...@@ -929,7 +929,7 @@ func (p *AnswerLockedTransactions) neoMsgDecode(data []byte) (int, error) {
goto overflow goto overflow
} }
{ {
l := binary.BigEndian.Uint32(data[0:]) l := binary.BigEndian.Uint32(data[0 : 0+4])
data = data[4:] data = data[4:]
if uint64(len(data)) < uint64(l)*16 { if uint64(len(data)) < uint64(l)*16 {
goto overflow goto overflow
...@@ -938,8 +938,8 @@ func (p *AnswerLockedTransactions) neoMsgDecode(data []byte) (int, error) { ...@@ -938,8 +938,8 @@ func (p *AnswerLockedTransactions) neoMsgDecode(data []byte) (int, error) {
p.TidDict = make(map[zodb.Tid]zodb.Tid, l) p.TidDict = make(map[zodb.Tid]zodb.Tid, l)
m := p.TidDict m := p.TidDict
for i := 0; uint32(i) < l; i++ { for i := 0; uint32(i) < l; i++ {
key := zodb.Tid(binary.BigEndian.Uint64(data[0:])) key := zodb.Tid(binary.BigEndian.Uint64(data[0 : 0+8]))
m[key] = zodb.Tid(binary.BigEndian.Uint64(data[8:])) m[key] = zodb.Tid(binary.BigEndian.Uint64(data[8 : 8+8]))
data = data[16:] data = data[16:]
} }
} }
...@@ -967,7 +967,7 @@ func (p *FinalTID) neoMsgDecode(data []byte) (int, error) { ...@@ -967,7 +967,7 @@ func (p *FinalTID) neoMsgDecode(data []byte) (int, error) {
if len(data) < 8 { if len(data) < 8 {
goto overflow goto overflow
} }
p.TTID = zodb.Tid(binary.BigEndian.Uint64(data[0:])) p.TTID = zodb.Tid(binary.BigEndian.Uint64(data[0 : 0+8]))
return 8, nil return 8, nil
overflow: overflow:
...@@ -992,7 +992,7 @@ func (p *AnswerFinalTID) neoMsgDecode(data []byte) (int, error) { ...@@ -992,7 +992,7 @@ func (p *AnswerFinalTID) neoMsgDecode(data []byte) (int, error) {
if len(data) < 8 { if len(data) < 8 {
goto overflow goto overflow
} }
p.Tid = zodb.Tid(binary.BigEndian.Uint64(data[0:])) p.Tid = zodb.Tid(binary.BigEndian.Uint64(data[0 : 0+8]))
return 8, nil return 8, nil
overflow: overflow:
...@@ -1018,8 +1018,8 @@ func (p *ValidateTransaction) neoMsgDecode(data []byte) (int, error) { ...@@ -1018,8 +1018,8 @@ func (p *ValidateTransaction) neoMsgDecode(data []byte) (int, error) {
if len(data) < 16 { if len(data) < 16 {
goto overflow goto overflow
} }
p.TTID = zodb.Tid(binary.BigEndian.Uint64(data[0:])) p.TTID = zodb.Tid(binary.BigEndian.Uint64(data[0 : 0+8]))
p.Tid = zodb.Tid(binary.BigEndian.Uint64(data[8:])) p.Tid = zodb.Tid(binary.BigEndian.Uint64(data[8 : 8+8]))
return 16, nil return 16, nil
overflow: overflow:
...@@ -1044,7 +1044,7 @@ func (p *BeginTransaction) neoMsgDecode(data []byte) (int, error) { ...@@ -1044,7 +1044,7 @@ func (p *BeginTransaction) neoMsgDecode(data []byte) (int, error) {
if len(data) < 8 { if len(data) < 8 {
goto overflow goto overflow
} }
p.Tid = zodb.Tid(binary.BigEndian.Uint64(data[0:])) p.Tid = zodb.Tid(binary.BigEndian.Uint64(data[0 : 0+8]))
return 8, nil return 8, nil
overflow: overflow:
...@@ -1069,7 +1069,7 @@ func (p *AnswerBeginTransaction) neoMsgDecode(data []byte) (int, error) { ...@@ -1069,7 +1069,7 @@ func (p *AnswerBeginTransaction) neoMsgDecode(data []byte) (int, error) {
if len(data) < 8 { if len(data) < 8 {
goto overflow goto overflow
} }
p.Tid = zodb.Tid(binary.BigEndian.Uint64(data[0:])) p.Tid = zodb.Tid(binary.BigEndian.Uint64(data[0 : 0+8]))
return 8, nil return 8, nil
overflow: overflow:
...@@ -1105,9 +1105,9 @@ func (p *FailedVote) neoMsgDecode(data []byte) (int, error) { ...@@ -1105,9 +1105,9 @@ func (p *FailedVote) neoMsgDecode(data []byte) (int, error) {
if len(data) < 12 { if len(data) < 12 {
goto overflow goto overflow
} }
p.Tid = zodb.Tid(binary.BigEndian.Uint64(data[0:])) p.Tid = zodb.Tid(binary.BigEndian.Uint64(data[0 : 0+8]))
{ {
l := binary.BigEndian.Uint32(data[8:]) l := binary.BigEndian.Uint32(data[8 : 8+4])
data = data[12:] data = data[12:]
if uint64(len(data)) < uint64(l)*4 { if uint64(len(data)) < uint64(l)*4 {
goto overflow goto overflow
...@@ -1116,7 +1116,7 @@ func (p *FailedVote) neoMsgDecode(data []byte) (int, error) { ...@@ -1116,7 +1116,7 @@ func (p *FailedVote) neoMsgDecode(data []byte) (int, error) {
p.NodeList = make([]NodeUUID, l) p.NodeList = make([]NodeUUID, l)
for i := 0; uint32(i) < l; i++ { for i := 0; uint32(i) < l; i++ {
a := &p.NodeList[i] a := &p.NodeList[i]
(*a) = NodeUUID(int32(binary.BigEndian.Uint32(data[0:]))) (*a) = NodeUUID(int32(binary.BigEndian.Uint32(data[0 : 0+4])))
data = data[4:] data = data[4:]
} }
} }
...@@ -1165,9 +1165,9 @@ func (p *FinishTransaction) neoMsgDecode(data []byte) (int, error) { ...@@ -1165,9 +1165,9 @@ func (p *FinishTransaction) neoMsgDecode(data []byte) (int, error) {
if len(data) < 12 { if len(data) < 12 {
goto overflow goto overflow
} }
p.Tid = zodb.Tid(binary.BigEndian.Uint64(data[0:])) p.Tid = zodb.Tid(binary.BigEndian.Uint64(data[0 : 0+8]))
{ {
l := binary.BigEndian.Uint32(data[8:]) l := binary.BigEndian.Uint32(data[8 : 8+4])
data = data[12:] data = data[12:]
if uint64(len(data)) < 4+uint64(l)*8 { if uint64(len(data)) < 4+uint64(l)*8 {
goto overflow goto overflow
...@@ -1176,12 +1176,12 @@ func (p *FinishTransaction) neoMsgDecode(data []byte) (int, error) { ...@@ -1176,12 +1176,12 @@ func (p *FinishTransaction) neoMsgDecode(data []byte) (int, error) {
p.OIDList = make([]zodb.Oid, l) p.OIDList = make([]zodb.Oid, l)
for i := 0; uint32(i) < l; i++ { for i := 0; uint32(i) < l; i++ {
a := &p.OIDList[i] a := &p.OIDList[i]
(*a) = zodb.Oid(binary.BigEndian.Uint64(data[0:])) (*a) = zodb.Oid(binary.BigEndian.Uint64(data[0 : 0+8]))
data = data[8:] data = data[8:]
} }
} }
{ {
l := binary.BigEndian.Uint32(data[0:]) l := binary.BigEndian.Uint32(data[0 : 0+4])
data = data[4:] data = data[4:]
if uint64(len(data)) < uint64(l)*8 { if uint64(len(data)) < uint64(l)*8 {
goto overflow goto overflow
...@@ -1190,7 +1190,7 @@ func (p *FinishTransaction) neoMsgDecode(data []byte) (int, error) { ...@@ -1190,7 +1190,7 @@ func (p *FinishTransaction) neoMsgDecode(data []byte) (int, error) {
p.CheckedList = make([]zodb.Oid, l) p.CheckedList = make([]zodb.Oid, l)
for i := 0; uint32(i) < l; i++ { for i := 0; uint32(i) < l; i++ {
a := &p.CheckedList[i] a := &p.CheckedList[i]
(*a) = zodb.Oid(binary.BigEndian.Uint64(data[0:])) (*a) = zodb.Oid(binary.BigEndian.Uint64(data[0 : 0+8]))
data = data[8:] data = data[8:]
} }
} }
...@@ -1219,8 +1219,8 @@ func (p *AnswerTransactionFinished) neoMsgDecode(data []byte) (int, error) { ...@@ -1219,8 +1219,8 @@ func (p *AnswerTransactionFinished) neoMsgDecode(data []byte) (int, error) {
if len(data) < 16 { if len(data) < 16 {
goto overflow goto overflow
} }
p.TTid = zodb.Tid(binary.BigEndian.Uint64(data[0:])) p.TTid = zodb.Tid(binary.BigEndian.Uint64(data[0 : 0+8]))
p.Tid = zodb.Tid(binary.BigEndian.Uint64(data[8:])) p.Tid = zodb.Tid(binary.BigEndian.Uint64(data[8 : 8+8]))
return 16, nil return 16, nil
overflow: overflow:
...@@ -1246,8 +1246,8 @@ func (p *LockInformation) neoMsgDecode(data []byte) (int, error) { ...@@ -1246,8 +1246,8 @@ func (p *LockInformation) neoMsgDecode(data []byte) (int, error) {
if len(data) < 16 { if len(data) < 16 {
goto overflow goto overflow
} }
p.Ttid = zodb.Tid(binary.BigEndian.Uint64(data[0:])) p.Ttid = zodb.Tid(binary.BigEndian.Uint64(data[0 : 0+8]))
p.Tid = zodb.Tid(binary.BigEndian.Uint64(data[8:])) p.Tid = zodb.Tid(binary.BigEndian.Uint64(data[8 : 8+8]))
return 16, nil return 16, nil
overflow: overflow:
...@@ -1272,7 +1272,7 @@ func (p *AnswerInformationLocked) neoMsgDecode(data []byte) (int, error) { ...@@ -1272,7 +1272,7 @@ func (p *AnswerInformationLocked) neoMsgDecode(data []byte) (int, error) {
if len(data) < 8 { if len(data) < 8 {
goto overflow goto overflow
} }
p.Ttid = zodb.Tid(binary.BigEndian.Uint64(data[0:])) p.Ttid = zodb.Tid(binary.BigEndian.Uint64(data[0 : 0+8]))
return 8, nil return 8, nil
overflow: overflow:
...@@ -1308,9 +1308,9 @@ func (p *InvalidateObjects) neoMsgDecode(data []byte) (int, error) { ...@@ -1308,9 +1308,9 @@ func (p *InvalidateObjects) neoMsgDecode(data []byte) (int, error) {
if len(data) < 12 { if len(data) < 12 {
goto overflow goto overflow
} }
p.Tid = zodb.Tid(binary.BigEndian.Uint64(data[0:])) p.Tid = zodb.Tid(binary.BigEndian.Uint64(data[0 : 0+8]))
{ {
l := binary.BigEndian.Uint32(data[8:]) l := binary.BigEndian.Uint32(data[8 : 8+4])
data = data[12:] data = data[12:]
if uint64(len(data)) < uint64(l)*8 { if uint64(len(data)) < uint64(l)*8 {
goto overflow goto overflow
...@@ -1319,7 +1319,7 @@ func (p *InvalidateObjects) neoMsgDecode(data []byte) (int, error) { ...@@ -1319,7 +1319,7 @@ func (p *InvalidateObjects) neoMsgDecode(data []byte) (int, error) {
p.OidList = make([]zodb.Oid, l) p.OidList = make([]zodb.Oid, l)
for i := 0; uint32(i) < l; i++ { for i := 0; uint32(i) < l; i++ {
a := &p.OidList[i] a := &p.OidList[i]
(*a) = zodb.Oid(binary.BigEndian.Uint64(data[0:])) (*a) = zodb.Oid(binary.BigEndian.Uint64(data[0 : 0+8]))
data = data[8:] data = data[8:]
} }
} }
...@@ -1347,7 +1347,7 @@ func (p *NotifyUnlockInformation) neoMsgDecode(data []byte) (int, error) { ...@@ -1347,7 +1347,7 @@ func (p *NotifyUnlockInformation) neoMsgDecode(data []byte) (int, error) {
if len(data) < 8 { if len(data) < 8 {
goto overflow goto overflow
} }
p.TTID = zodb.Tid(binary.BigEndian.Uint64(data[0:])) p.TTID = zodb.Tid(binary.BigEndian.Uint64(data[0 : 0+8]))
return 8, nil return 8, nil
overflow: overflow:
...@@ -1372,7 +1372,7 @@ func (p *AskNewOIDs) neoMsgDecode(data []byte) (int, error) { ...@@ -1372,7 +1372,7 @@ func (p *AskNewOIDs) neoMsgDecode(data []byte) (int, error) {
if len(data) < 4 { if len(data) < 4 {
goto overflow goto overflow
} }
p.NumOIDs = binary.BigEndian.Uint32(data[0:]) p.NumOIDs = binary.BigEndian.Uint32(data[0 : 0+4])
return 4, nil return 4, nil
overflow: overflow:
...@@ -1408,7 +1408,7 @@ func (p *AnswerNewOIDs) neoMsgDecode(data []byte) (int, error) { ...@@ -1408,7 +1408,7 @@ func (p *AnswerNewOIDs) neoMsgDecode(data []byte) (int, error) {
goto overflow goto overflow
} }
{ {
l := binary.BigEndian.Uint32(data[0:]) l := binary.BigEndian.Uint32(data[0 : 0+4])
data = data[4:] data = data[4:]
if uint64(len(data)) < uint64(l)*8 { if uint64(len(data)) < uint64(l)*8 {
goto overflow goto overflow
...@@ -1417,7 +1417,7 @@ func (p *AnswerNewOIDs) neoMsgDecode(data []byte) (int, error) { ...@@ -1417,7 +1417,7 @@ func (p *AnswerNewOIDs) neoMsgDecode(data []byte) (int, error) {
p.OidList = make([]zodb.Oid, l) p.OidList = make([]zodb.Oid, l)
for i := 0; uint32(i) < l; i++ { for i := 0; uint32(i) < l; i++ {
a := &p.OidList[i] a := &p.OidList[i]
(*a) = zodb.Oid(binary.BigEndian.Uint64(data[0:])) (*a) = zodb.Oid(binary.BigEndian.Uint64(data[0 : 0+8]))
data = data[8:] data = data[8:]
} }
} }
...@@ -1446,8 +1446,8 @@ func (p *NotifyDeadlock) neoMsgDecode(data []byte) (int, error) { ...@@ -1446,8 +1446,8 @@ func (p *NotifyDeadlock) neoMsgDecode(data []byte) (int, error) {
if len(data) < 16 { if len(data) < 16 {
goto overflow goto overflow
} }
p.TTid = zodb.Tid(binary.BigEndian.Uint64(data[0:])) p.TTid = zodb.Tid(binary.BigEndian.Uint64(data[0 : 0+8]))
p.LockingTid = zodb.Tid(binary.BigEndian.Uint64(data[8:])) p.LockingTid = zodb.Tid(binary.BigEndian.Uint64(data[8 : 8+8]))
return 16, nil return 16, nil
overflow: overflow:
...@@ -1473,8 +1473,8 @@ func (p *RebaseTransaction) neoMsgDecode(data []byte) (int, error) { ...@@ -1473,8 +1473,8 @@ func (p *RebaseTransaction) neoMsgDecode(data []byte) (int, error) {
if len(data) < 16 { if len(data) < 16 {
goto overflow goto overflow
} }
p.TTid = zodb.Tid(binary.BigEndian.Uint64(data[0:])) p.TTid = zodb.Tid(binary.BigEndian.Uint64(data[0 : 0+8]))
p.LockingTid = zodb.Tid(binary.BigEndian.Uint64(data[8:])) p.LockingTid = zodb.Tid(binary.BigEndian.Uint64(data[8 : 8+8]))
return 16, nil return 16, nil
overflow: overflow:
...@@ -1510,7 +1510,7 @@ func (p *AnswerRebaseTransaction) neoMsgDecode(data []byte) (int, error) { ...@@ -1510,7 +1510,7 @@ func (p *AnswerRebaseTransaction) neoMsgDecode(data []byte) (int, error) {
goto overflow goto overflow
} }
{ {
l := binary.BigEndian.Uint32(data[0:]) l := binary.BigEndian.Uint32(data[0 : 0+4])
data = data[4:] data = data[4:]
if uint64(len(data)) < uint64(l)*8 { if uint64(len(data)) < uint64(l)*8 {
goto overflow goto overflow
...@@ -1519,7 +1519,7 @@ func (p *AnswerRebaseTransaction) neoMsgDecode(data []byte) (int, error) { ...@@ -1519,7 +1519,7 @@ func (p *AnswerRebaseTransaction) neoMsgDecode(data []byte) (int, error) {
p.OidList = make([]zodb.Oid, l) p.OidList = make([]zodb.Oid, l)
for i := 0; uint32(i) < l; i++ { for i := 0; uint32(i) < l; i++ {
a := &p.OidList[i] a := &p.OidList[i]
(*a) = zodb.Oid(binary.BigEndian.Uint64(data[0:])) (*a) = zodb.Oid(binary.BigEndian.Uint64(data[0 : 0+8]))
data = data[8:] data = data[8:]
} }
} }
...@@ -1548,8 +1548,8 @@ func (p *RebaseObject) neoMsgDecode(data []byte) (int, error) { ...@@ -1548,8 +1548,8 @@ func (p *RebaseObject) neoMsgDecode(data []byte) (int, error) {
if len(data) < 16 { if len(data) < 16 {
goto overflow goto overflow
} }
p.TTid = zodb.Tid(binary.BigEndian.Uint64(data[0:])) p.TTid = zodb.Tid(binary.BigEndian.Uint64(data[0 : 0+8]))
p.Oid = zodb.Oid(binary.BigEndian.Uint64(data[8:])) p.Oid = zodb.Oid(binary.BigEndian.Uint64(data[8 : 8+8]))
return 16, nil return 16, nil
overflow: overflow:
...@@ -1585,12 +1585,12 @@ func (p *AnswerRebaseObject) neoMsgDecode(data []byte) (int, error) { ...@@ -1585,12 +1585,12 @@ func (p *AnswerRebaseObject) neoMsgDecode(data []byte) (int, error) {
if len(data) < 41 { if len(data) < 41 {
goto overflow goto overflow
} }
p.Serial = zodb.Tid(binary.BigEndian.Uint64(data[0:])) p.Serial = zodb.Tid(binary.BigEndian.Uint64(data[0 : 0+8]))
p.ConflictSerial = zodb.Tid(binary.BigEndian.Uint64(data[8:])) p.ConflictSerial = zodb.Tid(binary.BigEndian.Uint64(data[8 : 8+8]))
p.Compression = byte2bool((data[16:])[0]) p.Compression = byte2bool((data[16 : 16+1])[0])
copy(p.Checksum[:], data[17:37]) copy(p.Checksum[:], data[17:37])
{ {
l := binary.BigEndian.Uint32(data[37:]) l := binary.BigEndian.Uint32(data[37 : 37+4])
data = data[41:] data = data[41:]
if uint64(len(data)) < uint64(l) { if uint64(len(data)) < uint64(l) {
goto overflow goto overflow
...@@ -1637,12 +1637,12 @@ func (p *StoreObject) neoMsgDecode(data []byte) (int, error) { ...@@ -1637,12 +1637,12 @@ func (p *StoreObject) neoMsgDecode(data []byte) (int, error) {
if len(data) < 41 { if len(data) < 41 {
goto overflow goto overflow
} }
p.Oid = zodb.Oid(binary.BigEndian.Uint64(data[0:])) p.Oid = zodb.Oid(binary.BigEndian.Uint64(data[0 : 0+8]))
p.Serial = zodb.Tid(binary.BigEndian.Uint64(data[8:])) p.Serial = zodb.Tid(binary.BigEndian.Uint64(data[8 : 8+8]))
p.Compression = byte2bool((data[16:])[0]) p.Compression = byte2bool((data[16 : 16+1])[0])
copy(p.Checksum[:], data[17:37]) copy(p.Checksum[:], data[17:37])
{ {
l := binary.BigEndian.Uint32(data[37:]) l := binary.BigEndian.Uint32(data[37 : 37+4])
data = data[41:] data = data[41:]
if uint64(len(data)) < 16+uint64(l) { if uint64(len(data)) < 16+uint64(l) {
goto overflow goto overflow
...@@ -1652,8 +1652,8 @@ func (p *StoreObject) neoMsgDecode(data []byte) (int, error) { ...@@ -1652,8 +1652,8 @@ func (p *StoreObject) neoMsgDecode(data []byte) (int, error) {
copy(p.Data, data[:l]) copy(p.Data, data[:l])
data = data[l:] data = data[l:]
} }
p.DataSerial = zodb.Tid(binary.BigEndian.Uint64(data[0:])) p.DataSerial = zodb.Tid(binary.BigEndian.Uint64(data[0 : 0+8]))
p.Tid = zodb.Tid(binary.BigEndian.Uint64(data[8:])) p.Tid = zodb.Tid(binary.BigEndian.Uint64(data[8 : 8+8]))
return 41 + int(nread), nil return 41 + int(nread), nil
overflow: overflow:
...@@ -1678,7 +1678,7 @@ func (p *AnswerStoreObject) neoMsgDecode(data []byte) (int, error) { ...@@ -1678,7 +1678,7 @@ func (p *AnswerStoreObject) neoMsgDecode(data []byte) (int, error) {
if len(data) < 8 { if len(data) < 8 {
goto overflow goto overflow
} }
p.Conflict = zodb.Tid(binary.BigEndian.Uint64(data[0:])) p.Conflict = zodb.Tid(binary.BigEndian.Uint64(data[0 : 0+8]))
return 8, nil return 8, nil
overflow: overflow:
...@@ -1714,9 +1714,9 @@ func (p *AbortTransaction) neoMsgDecode(data []byte) (int, error) { ...@@ -1714,9 +1714,9 @@ func (p *AbortTransaction) neoMsgDecode(data []byte) (int, error) {
if len(data) < 12 { if len(data) < 12 {
goto overflow goto overflow
} }
p.Tid = zodb.Tid(binary.BigEndian.Uint64(data[0:])) p.Tid = zodb.Tid(binary.BigEndian.Uint64(data[0 : 0+8]))
{ {
l := binary.BigEndian.Uint32(data[8:]) l := binary.BigEndian.Uint32(data[8 : 8+4])
data = data[12:] data = data[12:]
if uint64(len(data)) < uint64(l)*4 { if uint64(len(data)) < uint64(l)*4 {
goto overflow goto overflow
...@@ -1725,7 +1725,7 @@ func (p *AbortTransaction) neoMsgDecode(data []byte) (int, error) { ...@@ -1725,7 +1725,7 @@ func (p *AbortTransaction) neoMsgDecode(data []byte) (int, error) {
p.NodeList = make([]NodeUUID, l) p.NodeList = make([]NodeUUID, l)
for i := 0; uint32(i) < l; i++ { for i := 0; uint32(i) < l; i++ {
a := &p.NodeList[i] a := &p.NodeList[i]
(*a) = NodeUUID(int32(binary.BigEndian.Uint32(data[0:]))) (*a) = NodeUUID(int32(binary.BigEndian.Uint32(data[0 : 0+4])))
data = data[4:] data = data[4:]
} }
} }
...@@ -1785,9 +1785,9 @@ func (p *StoreTransaction) neoMsgDecode(data []byte) (int, error) { ...@@ -1785,9 +1785,9 @@ func (p *StoreTransaction) neoMsgDecode(data []byte) (int, error) {
if len(data) < 12 { if len(data) < 12 {
goto overflow goto overflow
} }
p.Tid = zodb.Tid(binary.BigEndian.Uint64(data[0:])) p.Tid = zodb.Tid(binary.BigEndian.Uint64(data[0 : 0+8]))
{ {
l := binary.BigEndian.Uint32(data[8:]) l := binary.BigEndian.Uint32(data[8 : 8+4])
data = data[12:] data = data[12:]
if uint64(len(data)) < 4+uint64(l) { if uint64(len(data)) < 4+uint64(l) {
goto overflow goto overflow
...@@ -1797,7 +1797,7 @@ func (p *StoreTransaction) neoMsgDecode(data []byte) (int, error) { ...@@ -1797,7 +1797,7 @@ func (p *StoreTransaction) neoMsgDecode(data []byte) (int, error) {
data = data[l:] data = data[l:]
} }
{ {
l := binary.BigEndian.Uint32(data[0:]) l := binary.BigEndian.Uint32(data[0 : 0+4])
data = data[4:] data = data[4:]
if uint64(len(data)) < 4+uint64(l) { if uint64(len(data)) < 4+uint64(l) {
goto overflow goto overflow
...@@ -1807,7 +1807,7 @@ func (p *StoreTransaction) neoMsgDecode(data []byte) (int, error) { ...@@ -1807,7 +1807,7 @@ func (p *StoreTransaction) neoMsgDecode(data []byte) (int, error) {
data = data[l:] data = data[l:]
} }
{ {
l := binary.BigEndian.Uint32(data[0:]) l := binary.BigEndian.Uint32(data[0 : 0+4])
data = data[4:] data = data[4:]
if uint64(len(data)) < 4+uint64(l) { if uint64(len(data)) < 4+uint64(l) {
goto overflow goto overflow
...@@ -1817,7 +1817,7 @@ func (p *StoreTransaction) neoMsgDecode(data []byte) (int, error) { ...@@ -1817,7 +1817,7 @@ func (p *StoreTransaction) neoMsgDecode(data []byte) (int, error) {
data = data[l:] data = data[l:]
} }
{ {
l := binary.BigEndian.Uint32(data[0:]) l := binary.BigEndian.Uint32(data[0 : 0+4])
data = data[4:] data = data[4:]
if uint64(len(data)) < uint64(l)*8 { if uint64(len(data)) < uint64(l)*8 {
goto overflow goto overflow
...@@ -1826,7 +1826,7 @@ func (p *StoreTransaction) neoMsgDecode(data []byte) (int, error) { ...@@ -1826,7 +1826,7 @@ func (p *StoreTransaction) neoMsgDecode(data []byte) (int, error) {
p.OidList = make([]zodb.Oid, l) p.OidList = make([]zodb.Oid, l)
for i := 0; uint32(i) < l; i++ { for i := 0; uint32(i) < l; i++ {
a := &p.OidList[i] a := &p.OidList[i]
(*a) = zodb.Oid(binary.BigEndian.Uint64(data[0:])) (*a) = zodb.Oid(binary.BigEndian.Uint64(data[0 : 0+8]))
data = data[8:] data = data[8:]
} }
} }
...@@ -1871,7 +1871,7 @@ func (p *VoteTransaction) neoMsgDecode(data []byte) (int, error) { ...@@ -1871,7 +1871,7 @@ func (p *VoteTransaction) neoMsgDecode(data []byte) (int, error) {
if len(data) < 8 { if len(data) < 8 {
goto overflow goto overflow
} }
p.Tid = zodb.Tid(binary.BigEndian.Uint64(data[0:])) p.Tid = zodb.Tid(binary.BigEndian.Uint64(data[0 : 0+8]))
return 8, nil return 8, nil
overflow: overflow:
...@@ -1915,9 +1915,9 @@ func (p *GetObject) neoMsgDecode(data []byte) (int, error) { ...@@ -1915,9 +1915,9 @@ func (p *GetObject) neoMsgDecode(data []byte) (int, error) {
if len(data) < 24 { if len(data) < 24 {
goto overflow goto overflow
} }
p.Oid = zodb.Oid(binary.BigEndian.Uint64(data[0:])) p.Oid = zodb.Oid(binary.BigEndian.Uint64(data[0 : 0+8]))
p.Serial = zodb.Tid(binary.BigEndian.Uint64(data[8:])) p.Serial = zodb.Tid(binary.BigEndian.Uint64(data[8 : 8+8]))
p.Tid = zodb.Tid(binary.BigEndian.Uint64(data[16:])) p.Tid = zodb.Tid(binary.BigEndian.Uint64(data[16 : 16+8]))
return 24, nil return 24, nil
overflow: overflow:
...@@ -1955,13 +1955,13 @@ func (p *AnswerObject) neoMsgDecode(data []byte) (int, error) { ...@@ -1955,13 +1955,13 @@ func (p *AnswerObject) neoMsgDecode(data []byte) (int, error) {
if len(data) < 49 { if len(data) < 49 {
goto overflow goto overflow
} }
p.Oid = zodb.Oid(binary.BigEndian.Uint64(data[0:])) p.Oid = zodb.Oid(binary.BigEndian.Uint64(data[0 : 0+8]))
p.Serial = zodb.Tid(binary.BigEndian.Uint64(data[8:])) p.Serial = zodb.Tid(binary.BigEndian.Uint64(data[8 : 8+8]))
p.NextSerial = zodb.Tid(binary.BigEndian.Uint64(data[16:])) p.NextSerial = zodb.Tid(binary.BigEndian.Uint64(data[16 : 16+8]))
p.Compression = byte2bool((data[24:])[0]) p.Compression = byte2bool((data[24 : 24+1])[0])
copy(p.Checksum[:], data[25:45]) copy(p.Checksum[:], data[25:45])
{ {
l := binary.BigEndian.Uint32(data[45:]) l := binary.BigEndian.Uint32(data[45 : 45+4])
data = data[49:] data = data[49:]
if uint64(len(data)) < 8+uint64(l) { if uint64(len(data)) < 8+uint64(l) {
goto overflow goto overflow
...@@ -1971,7 +1971,7 @@ func (p *AnswerObject) neoMsgDecode(data []byte) (int, error) { ...@@ -1971,7 +1971,7 @@ func (p *AnswerObject) neoMsgDecode(data []byte) (int, error) {
copy(p.Data.Data, data[:l]) copy(p.Data.Data, data[:l])
data = data[l:] data = data[l:]
} }
p.DataSerial = zodb.Tid(binary.BigEndian.Uint64(data[0:])) p.DataSerial = zodb.Tid(binary.BigEndian.Uint64(data[0 : 0+8]))
return 49 + int(nread), nil return 49 + int(nread), nil
overflow: overflow:
...@@ -1998,9 +1998,9 @@ func (p *AskTIDs) neoMsgDecode(data []byte) (int, error) { ...@@ -1998,9 +1998,9 @@ func (p *AskTIDs) neoMsgDecode(data []byte) (int, error) {
if len(data) < 20 { if len(data) < 20 {
goto overflow goto overflow
} }
p.First = binary.BigEndian.Uint64(data[0:]) p.First = binary.BigEndian.Uint64(data[0 : 0+8])
p.Last = binary.BigEndian.Uint64(data[8:]) p.Last = binary.BigEndian.Uint64(data[8 : 8+8])
p.Partition = binary.BigEndian.Uint32(data[16:]) p.Partition = binary.BigEndian.Uint32(data[16 : 16+4])
return 20, nil return 20, nil
overflow: overflow:
...@@ -2036,7 +2036,7 @@ func (p *AnswerTIDs) neoMsgDecode(data []byte) (int, error) { ...@@ -2036,7 +2036,7 @@ func (p *AnswerTIDs) neoMsgDecode(data []byte) (int, error) {
goto overflow goto overflow
} }
{ {
l := binary.BigEndian.Uint32(data[0:]) l := binary.BigEndian.Uint32(data[0 : 0+4])
data = data[4:] data = data[4:]
if uint64(len(data)) < uint64(l)*8 { if uint64(len(data)) < uint64(l)*8 {
goto overflow goto overflow
...@@ -2045,7 +2045,7 @@ func (p *AnswerTIDs) neoMsgDecode(data []byte) (int, error) { ...@@ -2045,7 +2045,7 @@ func (p *AnswerTIDs) neoMsgDecode(data []byte) (int, error) {
p.TIDList = make([]zodb.Tid, l) p.TIDList = make([]zodb.Tid, l)
for i := 0; uint32(i) < l; i++ { for i := 0; uint32(i) < l; i++ {
a := &p.TIDList[i] a := &p.TIDList[i]
(*a) = zodb.Tid(binary.BigEndian.Uint64(data[0:])) (*a) = zodb.Tid(binary.BigEndian.Uint64(data[0 : 0+8]))
data = data[8:] data = data[8:]
} }
} }
...@@ -2073,7 +2073,7 @@ func (p *TransactionInformation) neoMsgDecode(data []byte) (int, error) { ...@@ -2073,7 +2073,7 @@ func (p *TransactionInformation) neoMsgDecode(data []byte) (int, error) {
if len(data) < 8 { if len(data) < 8 {
goto overflow goto overflow
} }
p.Tid = zodb.Tid(binary.BigEndian.Uint64(data[0:])) p.Tid = zodb.Tid(binary.BigEndian.Uint64(data[0 : 0+8]))
return 8, nil return 8, nil
overflow: overflow:
...@@ -2131,9 +2131,9 @@ func (p *AnswerTransactionInformation) neoMsgDecode(data []byte) (int, error) { ...@@ -2131,9 +2131,9 @@ func (p *AnswerTransactionInformation) neoMsgDecode(data []byte) (int, error) {
if len(data) < 12 { if len(data) < 12 {
goto overflow goto overflow
} }
p.Tid = zodb.Tid(binary.BigEndian.Uint64(data[0:])) p.Tid = zodb.Tid(binary.BigEndian.Uint64(data[0 : 0+8]))
{ {
l := binary.BigEndian.Uint32(data[8:]) l := binary.BigEndian.Uint32(data[8 : 8+4])
data = data[12:] data = data[12:]
if uint64(len(data)) < 4+uint64(l) { if uint64(len(data)) < 4+uint64(l) {
goto overflow goto overflow
...@@ -2143,7 +2143,7 @@ func (p *AnswerTransactionInformation) neoMsgDecode(data []byte) (int, error) { ...@@ -2143,7 +2143,7 @@ func (p *AnswerTransactionInformation) neoMsgDecode(data []byte) (int, error) {
data = data[l:] data = data[l:]
} }
{ {
l := binary.BigEndian.Uint32(data[0:]) l := binary.BigEndian.Uint32(data[0 : 0+4])
data = data[4:] data = data[4:]
if uint64(len(data)) < 4+uint64(l) { if uint64(len(data)) < 4+uint64(l) {
goto overflow goto overflow
...@@ -2153,7 +2153,7 @@ func (p *AnswerTransactionInformation) neoMsgDecode(data []byte) (int, error) { ...@@ -2153,7 +2153,7 @@ func (p *AnswerTransactionInformation) neoMsgDecode(data []byte) (int, error) {
data = data[l:] data = data[l:]
} }
{ {
l := binary.BigEndian.Uint32(data[0:]) l := binary.BigEndian.Uint32(data[0 : 0+4])
data = data[4:] data = data[4:]
if uint64(len(data)) < 5+uint64(l) { if uint64(len(data)) < 5+uint64(l) {
goto overflow goto overflow
...@@ -2162,9 +2162,9 @@ func (p *AnswerTransactionInformation) neoMsgDecode(data []byte) (int, error) { ...@@ -2162,9 +2162,9 @@ func (p *AnswerTransactionInformation) neoMsgDecode(data []byte) (int, error) {
p.Extension = string(data[:l]) p.Extension = string(data[:l])
data = data[l:] data = data[l:]
} }
p.Packed = byte2bool((data[0:])[0]) p.Packed = byte2bool((data[0 : 0+1])[0])
{ {
l := binary.BigEndian.Uint32(data[1:]) l := binary.BigEndian.Uint32(data[1 : 1+4])
data = data[5:] data = data[5:]
if uint64(len(data)) < uint64(l)*8 { if uint64(len(data)) < uint64(l)*8 {
goto overflow goto overflow
...@@ -2173,7 +2173,7 @@ func (p *AnswerTransactionInformation) neoMsgDecode(data []byte) (int, error) { ...@@ -2173,7 +2173,7 @@ func (p *AnswerTransactionInformation) neoMsgDecode(data []byte) (int, error) {
p.OidList = make([]zodb.Oid, l) p.OidList = make([]zodb.Oid, l)
for i := 0; uint32(i) < l; i++ { for i := 0; uint32(i) < l; i++ {
a := &p.OidList[i] a := &p.OidList[i]
(*a) = zodb.Oid(binary.BigEndian.Uint64(data[0:])) (*a) = zodb.Oid(binary.BigEndian.Uint64(data[0 : 0+8]))
data = data[8:] data = data[8:]
} }
} }
...@@ -2203,9 +2203,9 @@ func (p *ObjectHistory) neoMsgDecode(data []byte) (int, error) { ...@@ -2203,9 +2203,9 @@ func (p *ObjectHistory) neoMsgDecode(data []byte) (int, error) {
if len(data) < 24 { if len(data) < 24 {
goto overflow goto overflow
} }
p.Oid = zodb.Oid(binary.BigEndian.Uint64(data[0:])) p.Oid = zodb.Oid(binary.BigEndian.Uint64(data[0 : 0+8]))
p.First = binary.BigEndian.Uint64(data[8:]) p.First = binary.BigEndian.Uint64(data[8 : 8+8])
p.Last = binary.BigEndian.Uint64(data[16:]) p.Last = binary.BigEndian.Uint64(data[16 : 16+8])
return 24, nil return 24, nil
overflow: overflow:
...@@ -2242,9 +2242,9 @@ func (p *AnswerObjectHistory) neoMsgDecode(data []byte) (int, error) { ...@@ -2242,9 +2242,9 @@ func (p *AnswerObjectHistory) neoMsgDecode(data []byte) (int, error) {
if len(data) < 12 { if len(data) < 12 {
goto overflow goto overflow
} }
p.Oid = zodb.Oid(binary.BigEndian.Uint64(data[0:])) p.Oid = zodb.Oid(binary.BigEndian.Uint64(data[0 : 0+8]))
{ {
l := binary.BigEndian.Uint32(data[8:]) l := binary.BigEndian.Uint32(data[8 : 8+4])
data = data[12:] data = data[12:]
if uint64(len(data)) < uint64(l)*12 { if uint64(len(data)) < uint64(l)*12 {
goto overflow goto overflow
...@@ -2256,8 +2256,8 @@ func (p *AnswerObjectHistory) neoMsgDecode(data []byte) (int, error) { ...@@ -2256,8 +2256,8 @@ func (p *AnswerObjectHistory) neoMsgDecode(data []byte) (int, error) {
}, l) }, l)
for i := 0; uint32(i) < l; i++ { for i := 0; uint32(i) < l; i++ {
a := &p.HistoryList[i] a := &p.HistoryList[i]
(*a).Serial = zodb.Tid(binary.BigEndian.Uint64(data[0:])) (*a).Serial = zodb.Tid(binary.BigEndian.Uint64(data[0 : 0+8]))
(*a).Size = binary.BigEndian.Uint32(data[8:]) (*a).Size = binary.BigEndian.Uint32(data[8 : 8+4])
data = data[12:] data = data[12:]
} }
} }
...@@ -2287,9 +2287,9 @@ func (p *PartitionList) neoMsgDecode(data []byte) (int, error) { ...@@ -2287,9 +2287,9 @@ func (p *PartitionList) neoMsgDecode(data []byte) (int, error) {
if len(data) < 12 { if len(data) < 12 {
goto overflow goto overflow
} }
p.MinOffset = binary.BigEndian.Uint32(data[0:]) p.MinOffset = binary.BigEndian.Uint32(data[0 : 0+4])
p.MaxOffset = binary.BigEndian.Uint32(data[4:]) p.MaxOffset = binary.BigEndian.Uint32(data[4 : 4+4])
p.NodeUUID = NodeUUID(int32(binary.BigEndian.Uint32(data[8:]))) p.NodeUUID = NodeUUID(int32(binary.BigEndian.Uint32(data[8 : 8+4])))
return 12, nil return 12, nil
overflow: overflow:
...@@ -2341,9 +2341,9 @@ func (p *AnswerPartitionList) neoMsgDecode(data []byte) (int, error) { ...@@ -2341,9 +2341,9 @@ func (p *AnswerPartitionList) neoMsgDecode(data []byte) (int, error) {
if len(data) < 12 { if len(data) < 12 {
goto overflow goto overflow
} }
p.PTid = PTid(binary.BigEndian.Uint64(data[0:])) p.PTid = PTid(binary.BigEndian.Uint64(data[0 : 0+8]))
{ {
l := binary.BigEndian.Uint32(data[8:]) l := binary.BigEndian.Uint32(data[8 : 8+4])
data = data[12:] data = data[12:]
p.RowList = make([]RowInfo, l) p.RowList = make([]RowInfo, l)
for i := 0; uint32(i) < l; i++ { for i := 0; uint32(i) < l; i++ {
...@@ -2351,9 +2351,9 @@ func (p *AnswerPartitionList) neoMsgDecode(data []byte) (int, error) { ...@@ -2351,9 +2351,9 @@ func (p *AnswerPartitionList) neoMsgDecode(data []byte) (int, error) {
if len(data) < 8 { if len(data) < 8 {
goto overflow goto overflow
} }
(*a).Offset = binary.BigEndian.Uint32(data[0:]) (*a).Offset = binary.BigEndian.Uint32(data[0 : 0+4])
{ {
l := binary.BigEndian.Uint32(data[4:]) l := binary.BigEndian.Uint32(data[4 : 4+4])
data = data[8:] data = data[8:]
if uint64(len(data)) < uint64(l)*8 { if uint64(len(data)) < uint64(l)*8 {
goto overflow goto overflow
...@@ -2362,8 +2362,8 @@ func (p *AnswerPartitionList) neoMsgDecode(data []byte) (int, error) { ...@@ -2362,8 +2362,8 @@ func (p *AnswerPartitionList) neoMsgDecode(data []byte) (int, error) {
(*a).CellList = make([]CellInfo, l) (*a).CellList = make([]CellInfo, l)
for i := 0; uint32(i) < l; i++ { for i := 0; uint32(i) < l; i++ {
a := &(*a).CellList[i] a := &(*a).CellList[i]
(*a).UUID = NodeUUID(int32(binary.BigEndian.Uint32(data[0:]))) (*a).UUID = NodeUUID(int32(binary.BigEndian.Uint32(data[0 : 0+4])))
(*a).State = CellState(int32(binary.BigEndian.Uint32(data[4:]))) (*a).State = CellState(int32(binary.BigEndian.Uint32(data[4 : 4+4])))
data = data[8:] data = data[8:]
} }
} }
...@@ -2394,7 +2394,7 @@ func (p *NodeList) neoMsgDecode(data []byte) (int, error) { ...@@ -2394,7 +2394,7 @@ func (p *NodeList) neoMsgDecode(data []byte) (int, error) {
if len(data) < 4 { if len(data) < 4 {
goto overflow goto overflow
} }
p.NodeType = NodeType(int32(binary.BigEndian.Uint32(data[0:]))) p.NodeType = NodeType(int32(binary.BigEndian.Uint32(data[0 : 0+4])))
return 4, nil return 4, nil
overflow: overflow:
...@@ -2445,7 +2445,7 @@ func (p *AnswerNodeList) neoMsgDecode(data []byte) (int, error) { ...@@ -2445,7 +2445,7 @@ func (p *AnswerNodeList) neoMsgDecode(data []byte) (int, error) {
goto overflow goto overflow
} }
{ {
l := binary.BigEndian.Uint32(data[0:]) l := binary.BigEndian.Uint32(data[0 : 0+4])
data = data[4:] data = data[4:]
p.NodeList = make([]NodeInfo, l) p.NodeList = make([]NodeInfo, l)
for i := 0; uint32(i) < l; i++ { for i := 0; uint32(i) < l; i++ {
...@@ -2453,7 +2453,7 @@ func (p *AnswerNodeList) neoMsgDecode(data []byte) (int, error) { ...@@ -2453,7 +2453,7 @@ func (p *AnswerNodeList) neoMsgDecode(data []byte) (int, error) {
if len(data) < 4 { if len(data) < 4 {
goto overflow goto overflow
} }
(*a).Type = NodeType(int32(binary.BigEndian.Uint32(data[0:]))) (*a).Type = NodeType(int32(binary.BigEndian.Uint32(data[0 : 0+4])))
data = data[4:] data = data[4:]
{ {
n, ok := (*a).Addr.neoDecode(data) n, ok := (*a).Addr.neoDecode(data)
...@@ -2466,8 +2466,8 @@ func (p *AnswerNodeList) neoMsgDecode(data []byte) (int, error) { ...@@ -2466,8 +2466,8 @@ func (p *AnswerNodeList) neoMsgDecode(data []byte) (int, error) {
if len(data) < 8 { if len(data) < 8 {
goto overflow goto overflow
} }
(*a).UUID = NodeUUID(int32(binary.BigEndian.Uint32(data[0:]))) (*a).UUID = NodeUUID(int32(binary.BigEndian.Uint32(data[0 : 0+4])))
(*a).State = NodeState(int32(binary.BigEndian.Uint32(data[4:]))) (*a).State = NodeState(int32(binary.BigEndian.Uint32(data[4 : 4+4])))
data = data[8:] data = data[8:]
{ {
n, ok := (*a).IdTime.neoDecode(data) n, ok := (*a).IdTime.neoDecode(data)
...@@ -2505,8 +2505,8 @@ func (p *SetNodeState) neoMsgDecode(data []byte) (int, error) { ...@@ -2505,8 +2505,8 @@ func (p *SetNodeState) neoMsgDecode(data []byte) (int, error) {
if len(data) < 8 { if len(data) < 8 {
goto overflow goto overflow
} }
p.NodeUUID = NodeUUID(int32(binary.BigEndian.Uint32(data[0:]))) p.NodeUUID = NodeUUID(int32(binary.BigEndian.Uint32(data[0 : 0+4])))
p.NodeState = NodeState(int32(binary.BigEndian.Uint32(data[4:]))) p.NodeState = NodeState(int32(binary.BigEndian.Uint32(data[4 : 4+4])))
return 8, nil return 8, nil
overflow: overflow:
...@@ -2542,7 +2542,7 @@ func (p *AddPendingNodes) neoMsgDecode(data []byte) (int, error) { ...@@ -2542,7 +2542,7 @@ func (p *AddPendingNodes) neoMsgDecode(data []byte) (int, error) {
goto overflow goto overflow
} }
{ {
l := binary.BigEndian.Uint32(data[0:]) l := binary.BigEndian.Uint32(data[0 : 0+4])
data = data[4:] data = data[4:]
if uint64(len(data)) < uint64(l)*4 { if uint64(len(data)) < uint64(l)*4 {
goto overflow goto overflow
...@@ -2551,7 +2551,7 @@ func (p *AddPendingNodes) neoMsgDecode(data []byte) (int, error) { ...@@ -2551,7 +2551,7 @@ func (p *AddPendingNodes) neoMsgDecode(data []byte) (int, error) {
p.NodeList = make([]NodeUUID, l) p.NodeList = make([]NodeUUID, l)
for i := 0; uint32(i) < l; i++ { for i := 0; uint32(i) < l; i++ {
a := &p.NodeList[i] a := &p.NodeList[i]
(*a) = NodeUUID(int32(binary.BigEndian.Uint32(data[0:]))) (*a) = NodeUUID(int32(binary.BigEndian.Uint32(data[0 : 0+4])))
data = data[4:] data = data[4:]
} }
} }
...@@ -2590,7 +2590,7 @@ func (p *TweakPartitionTable) neoMsgDecode(data []byte) (int, error) { ...@@ -2590,7 +2590,7 @@ func (p *TweakPartitionTable) neoMsgDecode(data []byte) (int, error) {
goto overflow goto overflow
} }
{ {
l := binary.BigEndian.Uint32(data[0:]) l := binary.BigEndian.Uint32(data[0 : 0+4])
data = data[4:] data = data[4:]
if uint64(len(data)) < uint64(l)*4 { if uint64(len(data)) < uint64(l)*4 {
goto overflow goto overflow
...@@ -2599,7 +2599,7 @@ func (p *TweakPartitionTable) neoMsgDecode(data []byte) (int, error) { ...@@ -2599,7 +2599,7 @@ func (p *TweakPartitionTable) neoMsgDecode(data []byte) (int, error) {
p.NodeList = make([]NodeUUID, l) p.NodeList = make([]NodeUUID, l)
for i := 0; uint32(i) < l; i++ { for i := 0; uint32(i) < l; i++ {
a := &p.NodeList[i] a := &p.NodeList[i]
(*a) = NodeUUID(int32(binary.BigEndian.Uint32(data[0:]))) (*a) = NodeUUID(int32(binary.BigEndian.Uint32(data[0 : 0+4])))
data = data[4:] data = data[4:]
} }
} }
...@@ -2627,7 +2627,7 @@ func (p *SetClusterState) neoMsgDecode(data []byte) (int, error) { ...@@ -2627,7 +2627,7 @@ func (p *SetClusterState) neoMsgDecode(data []byte) (int, error) {
if len(data) < 4 { if len(data) < 4 {
goto overflow goto overflow
} }
p.State = ClusterState(int32(binary.BigEndian.Uint32(data[0:]))) p.State = ClusterState(int32(binary.BigEndian.Uint32(data[0 : 0+4])))
return 4, nil return 4, nil
overflow: overflow:
...@@ -2664,7 +2664,7 @@ func (p *Repair) neoMsgDecode(data []byte) (int, error) { ...@@ -2664,7 +2664,7 @@ func (p *Repair) neoMsgDecode(data []byte) (int, error) {
goto overflow goto overflow
} }
{ {
l := binary.BigEndian.Uint32(data[0:]) l := binary.BigEndian.Uint32(data[0 : 0+4])
data = data[4:] data = data[4:]
if uint64(len(data)) < 1+uint64(l)*4 { if uint64(len(data)) < 1+uint64(l)*4 {
goto overflow goto overflow
...@@ -2673,11 +2673,11 @@ func (p *Repair) neoMsgDecode(data []byte) (int, error) { ...@@ -2673,11 +2673,11 @@ func (p *Repair) neoMsgDecode(data []byte) (int, error) {
p.NodeList = make([]NodeUUID, l) p.NodeList = make([]NodeUUID, l)
for i := 0; uint32(i) < l; i++ { for i := 0; uint32(i) < l; i++ {
a := &p.NodeList[i] a := &p.NodeList[i]
(*a) = NodeUUID(int32(binary.BigEndian.Uint32(data[0:]))) (*a) = NodeUUID(int32(binary.BigEndian.Uint32(data[0 : 0+4])))
data = data[4:] data = data[4:]
} }
} }
p.repairFlags.DryRun = byte2bool((data[0:])[0]) p.repairFlags.DryRun = byte2bool((data[0 : 0+1])[0])
return 4 + int(nread), nil return 4 + int(nread), nil
overflow: overflow:
...@@ -2702,7 +2702,7 @@ func (p *RepairOne) neoMsgDecode(data []byte) (int, error) { ...@@ -2702,7 +2702,7 @@ func (p *RepairOne) neoMsgDecode(data []byte) (int, error) {
if len(data) < 1 { if len(data) < 1 {
goto overflow goto overflow
} }
p.repairFlags.DryRun = byte2bool((data[0:])[0]) p.repairFlags.DryRun = byte2bool((data[0 : 0+1])[0])
return 1, nil return 1, nil
overflow: overflow:
...@@ -2727,7 +2727,7 @@ func (p *NotifyClusterState) neoMsgDecode(data []byte) (int, error) { ...@@ -2727,7 +2727,7 @@ func (p *NotifyClusterState) neoMsgDecode(data []byte) (int, error) {
if len(data) < 4 { if len(data) < 4 {
goto overflow goto overflow
} }
p.State = ClusterState(int32(binary.BigEndian.Uint32(data[0:]))) p.State = ClusterState(int32(binary.BigEndian.Uint32(data[0 : 0+4])))
return 4, nil return 4, nil
overflow: overflow:
...@@ -2769,7 +2769,7 @@ func (p *AnswerClusterState) neoMsgDecode(data []byte) (int, error) { ...@@ -2769,7 +2769,7 @@ func (p *AnswerClusterState) neoMsgDecode(data []byte) (int, error) {
if len(data) < 4 { if len(data) < 4 {
goto overflow goto overflow
} }
p.State = ClusterState(int32(binary.BigEndian.Uint32(data[0:]))) p.State = ClusterState(int32(binary.BigEndian.Uint32(data[0 : 0+4])))
return 4, nil return 4, nil
overflow: overflow:
...@@ -2807,11 +2807,11 @@ func (p *ObjectUndoSerial) neoMsgDecode(data []byte) (int, error) { ...@@ -2807,11 +2807,11 @@ func (p *ObjectUndoSerial) neoMsgDecode(data []byte) (int, error) {
if len(data) < 28 { if len(data) < 28 {
goto overflow goto overflow
} }
p.Tid = zodb.Tid(binary.BigEndian.Uint64(data[0:])) p.Tid = zodb.Tid(binary.BigEndian.Uint64(data[0 : 0+8]))
p.LTID = zodb.Tid(binary.BigEndian.Uint64(data[8:])) p.LTID = zodb.Tid(binary.BigEndian.Uint64(data[8 : 8+8]))
p.UndoneTID = zodb.Tid(binary.BigEndian.Uint64(data[16:])) p.UndoneTID = zodb.Tid(binary.BigEndian.Uint64(data[16 : 16+8]))
{ {
l := binary.BigEndian.Uint32(data[24:]) l := binary.BigEndian.Uint32(data[24 : 24+4])
data = data[28:] data = data[28:]
if uint64(len(data)) < uint64(l)*8 { if uint64(len(data)) < uint64(l)*8 {
goto overflow goto overflow
...@@ -2820,7 +2820,7 @@ func (p *ObjectUndoSerial) neoMsgDecode(data []byte) (int, error) { ...@@ -2820,7 +2820,7 @@ func (p *ObjectUndoSerial) neoMsgDecode(data []byte) (int, error) {
p.OidList = make([]zodb.Oid, l) p.OidList = make([]zodb.Oid, l)
for i := 0; uint32(i) < l; i++ { for i := 0; uint32(i) < l; i++ {
a := &p.OidList[i] a := &p.OidList[i]
(*a) = zodb.Oid(binary.BigEndian.Uint64(data[0:])) (*a) = zodb.Oid(binary.BigEndian.Uint64(data[0 : 0+8]))
data = data[8:] data = data[8:]
} }
} }
...@@ -2866,7 +2866,7 @@ func (p *AnswerObjectUndoSerial) neoMsgDecode(data []byte) (int, error) { ...@@ -2866,7 +2866,7 @@ func (p *AnswerObjectUndoSerial) neoMsgDecode(data []byte) (int, error) {
goto overflow goto overflow
} }
{ {
l := binary.BigEndian.Uint32(data[0:]) l := binary.BigEndian.Uint32(data[0 : 0+4])
data = data[4:] data = data[4:]
if uint64(len(data)) < uint64(l)*25 { if uint64(len(data)) < uint64(l)*25 {
goto overflow goto overflow
...@@ -2879,15 +2879,15 @@ func (p *AnswerObjectUndoSerial) neoMsgDecode(data []byte) (int, error) { ...@@ -2879,15 +2879,15 @@ func (p *AnswerObjectUndoSerial) neoMsgDecode(data []byte) (int, error) {
}, l) }, l)
m := p.ObjectTIDDict m := p.ObjectTIDDict
for i := 0; uint32(i) < l; i++ { for i := 0; uint32(i) < l; i++ {
key := zodb.Oid(binary.BigEndian.Uint64(data[0:])) key := zodb.Oid(binary.BigEndian.Uint64(data[0 : 0+8]))
var v struct { var v struct {
CurrentSerial zodb.Tid CurrentSerial zodb.Tid
UndoSerial zodb.Tid UndoSerial zodb.Tid
IsCurrent bool IsCurrent bool
} }
v.CurrentSerial = zodb.Tid(binary.BigEndian.Uint64(data[8:])) v.CurrentSerial = zodb.Tid(binary.BigEndian.Uint64(data[8 : 8+8]))
v.UndoSerial = zodb.Tid(binary.BigEndian.Uint64(data[16:])) v.UndoSerial = zodb.Tid(binary.BigEndian.Uint64(data[16 : 16+8]))
v.IsCurrent = byte2bool((data[24:])[0]) v.IsCurrent = byte2bool((data[24 : 24+1])[0])
m[key] = v m[key] = v
data = data[25:] data = data[25:]
} }
...@@ -2919,10 +2919,10 @@ func (p *AskTIDsFrom) neoMsgDecode(data []byte) (int, error) { ...@@ -2919,10 +2919,10 @@ func (p *AskTIDsFrom) neoMsgDecode(data []byte) (int, error) {
if len(data) < 24 { if len(data) < 24 {
goto overflow goto overflow
} }
p.MinTID = zodb.Tid(binary.BigEndian.Uint64(data[0:])) p.MinTID = zodb.Tid(binary.BigEndian.Uint64(data[0 : 0+8]))
p.MaxTID = zodb.Tid(binary.BigEndian.Uint64(data[8:])) p.MaxTID = zodb.Tid(binary.BigEndian.Uint64(data[8 : 8+8]))
p.Length = binary.BigEndian.Uint32(data[16:]) p.Length = binary.BigEndian.Uint32(data[16 : 16+4])
p.Partition = binary.BigEndian.Uint32(data[20:]) p.Partition = binary.BigEndian.Uint32(data[20 : 20+4])
return 24, nil return 24, nil
overflow: overflow:
...@@ -2958,7 +2958,7 @@ func (p *AnswerTIDsFrom) neoMsgDecode(data []byte) (int, error) { ...@@ -2958,7 +2958,7 @@ func (p *AnswerTIDsFrom) neoMsgDecode(data []byte) (int, error) {
goto overflow goto overflow
} }
{ {
l := binary.BigEndian.Uint32(data[0:]) l := binary.BigEndian.Uint32(data[0 : 0+4])
data = data[4:] data = data[4:]
if uint64(len(data)) < uint64(l)*8 { if uint64(len(data)) < uint64(l)*8 {
goto overflow goto overflow
...@@ -2967,7 +2967,7 @@ func (p *AnswerTIDsFrom) neoMsgDecode(data []byte) (int, error) { ...@@ -2967,7 +2967,7 @@ func (p *AnswerTIDsFrom) neoMsgDecode(data []byte) (int, error) {
p.TidList = make([]zodb.Tid, l) p.TidList = make([]zodb.Tid, l)
for i := 0; uint32(i) < l; i++ { for i := 0; uint32(i) < l; i++ {
a := &p.TidList[i] a := &p.TidList[i]
(*a) = zodb.Tid(binary.BigEndian.Uint64(data[0:])) (*a) = zodb.Tid(binary.BigEndian.Uint64(data[0 : 0+8]))
data = data[8:] data = data[8:]
} }
} }
...@@ -2995,7 +2995,7 @@ func (p *Pack) neoMsgDecode(data []byte) (int, error) { ...@@ -2995,7 +2995,7 @@ func (p *Pack) neoMsgDecode(data []byte) (int, error) {
if len(data) < 8 { if len(data) < 8 {
goto overflow goto overflow
} }
p.Tid = zodb.Tid(binary.BigEndian.Uint64(data[0:])) p.Tid = zodb.Tid(binary.BigEndian.Uint64(data[0 : 0+8]))
return 8, nil return 8, nil
overflow: overflow:
...@@ -3020,7 +3020,7 @@ func (p *AnswerPack) neoMsgDecode(data []byte) (int, error) { ...@@ -3020,7 +3020,7 @@ func (p *AnswerPack) neoMsgDecode(data []byte) (int, error) {
if len(data) < 1 { if len(data) < 1 {
goto overflow goto overflow
} }
p.Status = byte2bool((data[0:])[0]) p.Status = byte2bool((data[0 : 0+1])[0])
return 1, nil return 1, nil
overflow: overflow:
...@@ -3063,7 +3063,7 @@ func (p *CheckReplicas) neoMsgDecode(data []byte) (int, error) { ...@@ -3063,7 +3063,7 @@ func (p *CheckReplicas) neoMsgDecode(data []byte) (int, error) {
goto overflow goto overflow
} }
{ {
l := binary.BigEndian.Uint32(data[0:]) l := binary.BigEndian.Uint32(data[0 : 0+4])
data = data[4:] data = data[4:]
if uint64(len(data)) < 16+uint64(l)*8 { if uint64(len(data)) < 16+uint64(l)*8 {
goto overflow goto overflow
...@@ -3072,13 +3072,13 @@ func (p *CheckReplicas) neoMsgDecode(data []byte) (int, error) { ...@@ -3072,13 +3072,13 @@ func (p *CheckReplicas) neoMsgDecode(data []byte) (int, error) {
p.PartitionDict = make(map[uint32]NodeUUID, l) p.PartitionDict = make(map[uint32]NodeUUID, l)
m := p.PartitionDict m := p.PartitionDict
for i := 0; uint32(i) < l; i++ { for i := 0; uint32(i) < l; i++ {
key := binary.BigEndian.Uint32(data[0:]) key := binary.BigEndian.Uint32(data[0 : 0+4])
m[key] = NodeUUID(int32(binary.BigEndian.Uint32(data[4:]))) m[key] = NodeUUID(int32(binary.BigEndian.Uint32(data[4 : 4+4])))
data = data[8:] data = data[8:]
} }
} }
p.MinTID = zodb.Tid(binary.BigEndian.Uint64(data[0:])) p.MinTID = zodb.Tid(binary.BigEndian.Uint64(data[0 : 0+8]))
p.MaxTID = zodb.Tid(binary.BigEndian.Uint64(data[8:])) p.MaxTID = zodb.Tid(binary.BigEndian.Uint64(data[8 : 8+8]))
return 4 + int(nread), nil return 4 + int(nread), nil
overflow: overflow:
...@@ -3117,9 +3117,9 @@ func (p *CheckPartition) neoMsgDecode(data []byte) (int, error) { ...@@ -3117,9 +3117,9 @@ func (p *CheckPartition) neoMsgDecode(data []byte) (int, error) {
if len(data) < 8 { if len(data) < 8 {
goto overflow goto overflow
} }
p.Partition = binary.BigEndian.Uint32(data[0:]) p.Partition = binary.BigEndian.Uint32(data[0 : 0+4])
{ {
l := binary.BigEndian.Uint32(data[4:]) l := binary.BigEndian.Uint32(data[4 : 4+4])
data = data[8:] data = data[8:]
if uint64(len(data)) < uint64(l) { if uint64(len(data)) < uint64(l) {
goto overflow goto overflow
...@@ -3139,8 +3139,8 @@ func (p *CheckPartition) neoMsgDecode(data []byte) (int, error) { ...@@ -3139,8 +3139,8 @@ func (p *CheckPartition) neoMsgDecode(data []byte) (int, error) {
if len(data) < 16 { if len(data) < 16 {
goto overflow goto overflow
} }
p.MinTID = zodb.Tid(binary.BigEndian.Uint64(data[0:])) p.MinTID = zodb.Tid(binary.BigEndian.Uint64(data[0 : 0+8]))
p.MaxTID = zodb.Tid(binary.BigEndian.Uint64(data[8:])) p.MaxTID = zodb.Tid(binary.BigEndian.Uint64(data[8 : 8+8]))
return 24 + int(nread), nil return 24 + int(nread), nil
overflow: overflow:
...@@ -3168,10 +3168,10 @@ func (p *CheckTIDRange) neoMsgDecode(data []byte) (int, error) { ...@@ -3168,10 +3168,10 @@ func (p *CheckTIDRange) neoMsgDecode(data []byte) (int, error) {
if len(data) < 24 { if len(data) < 24 {
goto overflow goto overflow
} }
p.Partition = binary.BigEndian.Uint32(data[0:]) p.Partition = binary.BigEndian.Uint32(data[0 : 0+4])
p.Length = binary.BigEndian.Uint32(data[4:]) p.Length = binary.BigEndian.Uint32(data[4 : 4+4])
p.MinTID = zodb.Tid(binary.BigEndian.Uint64(data[8:])) p.MinTID = zodb.Tid(binary.BigEndian.Uint64(data[8 : 8+8]))
p.MaxTID = zodb.Tid(binary.BigEndian.Uint64(data[16:])) p.MaxTID = zodb.Tid(binary.BigEndian.Uint64(data[16 : 16+8]))
return 24, nil return 24, nil
overflow: overflow:
...@@ -3198,9 +3198,9 @@ func (p *AnswerCheckTIDRange) neoMsgDecode(data []byte) (int, error) { ...@@ -3198,9 +3198,9 @@ func (p *AnswerCheckTIDRange) neoMsgDecode(data []byte) (int, error) {
if len(data) < 32 { if len(data) < 32 {
goto overflow goto overflow
} }
p.Count = binary.BigEndian.Uint32(data[0:]) p.Count = binary.BigEndian.Uint32(data[0 : 0+4])
copy(p.Checksum[:], data[4:24]) copy(p.Checksum[:], data[4:24])
p.MaxTID = zodb.Tid(binary.BigEndian.Uint64(data[24:])) p.MaxTID = zodb.Tid(binary.BigEndian.Uint64(data[24 : 24+8]))
return 32, nil return 32, nil
overflow: overflow:
...@@ -3229,11 +3229,11 @@ func (p *CheckSerialRange) neoMsgDecode(data []byte) (int, error) { ...@@ -3229,11 +3229,11 @@ func (p *CheckSerialRange) neoMsgDecode(data []byte) (int, error) {
if len(data) < 32 { if len(data) < 32 {
goto overflow goto overflow
} }
p.Partition = binary.BigEndian.Uint32(data[0:]) p.Partition = binary.BigEndian.Uint32(data[0 : 0+4])
p.Length = binary.BigEndian.Uint32(data[4:]) p.Length = binary.BigEndian.Uint32(data[4 : 4+4])
p.MinTID = zodb.Tid(binary.BigEndian.Uint64(data[8:])) p.MinTID = zodb.Tid(binary.BigEndian.Uint64(data[8 : 8+8]))
p.MaxTID = zodb.Tid(binary.BigEndian.Uint64(data[16:])) p.MaxTID = zodb.Tid(binary.BigEndian.Uint64(data[16 : 16+8]))
p.MinOID = zodb.Oid(binary.BigEndian.Uint64(data[24:])) p.MinOID = zodb.Oid(binary.BigEndian.Uint64(data[24 : 24+8]))
return 32, nil return 32, nil
overflow: overflow:
...@@ -3262,11 +3262,11 @@ func (p *AnswerCheckSerialRange) neoMsgDecode(data []byte) (int, error) { ...@@ -3262,11 +3262,11 @@ func (p *AnswerCheckSerialRange) neoMsgDecode(data []byte) (int, error) {
if len(data) < 60 { if len(data) < 60 {
goto overflow goto overflow
} }
p.Count = binary.BigEndian.Uint32(data[0:]) p.Count = binary.BigEndian.Uint32(data[0 : 0+4])
copy(p.TidChecksum[:], data[4:24]) copy(p.TidChecksum[:], data[4:24])
p.MaxTID = zodb.Tid(binary.BigEndian.Uint64(data[24:])) p.MaxTID = zodb.Tid(binary.BigEndian.Uint64(data[24 : 24+8]))
copy(p.OidChecksum[:], data[32:52]) copy(p.OidChecksum[:], data[32:52])
p.MaxOID = zodb.Oid(binary.BigEndian.Uint64(data[52:])) p.MaxOID = zodb.Oid(binary.BigEndian.Uint64(data[52 : 52+8]))
return 60, nil return 60, nil
overflow: overflow:
...@@ -3302,9 +3302,9 @@ func (p *PartitionCorrupted) neoMsgDecode(data []byte) (int, error) { ...@@ -3302,9 +3302,9 @@ func (p *PartitionCorrupted) neoMsgDecode(data []byte) (int, error) {
if len(data) < 8 { if len(data) < 8 {
goto overflow goto overflow
} }
p.Partition = binary.BigEndian.Uint32(data[0:]) p.Partition = binary.BigEndian.Uint32(data[0 : 0+4])
{ {
l := binary.BigEndian.Uint32(data[4:]) l := binary.BigEndian.Uint32(data[4 : 4+4])
data = data[8:] data = data[8:]
if uint64(len(data)) < uint64(l)*4 { if uint64(len(data)) < uint64(l)*4 {
goto overflow goto overflow
...@@ -3313,7 +3313,7 @@ func (p *PartitionCorrupted) neoMsgDecode(data []byte) (int, error) { ...@@ -3313,7 +3313,7 @@ func (p *PartitionCorrupted) neoMsgDecode(data []byte) (int, error) {
p.CellList = make([]NodeUUID, l) p.CellList = make([]NodeUUID, l)
for i := 0; uint32(i) < l; i++ { for i := 0; uint32(i) < l; i++ {
a := &p.CellList[i] a := &p.CellList[i]
(*a) = NodeUUID(int32(binary.BigEndian.Uint32(data[0:]))) (*a) = NodeUUID(int32(binary.BigEndian.Uint32(data[0 : 0+4])))
data = data[4:] data = data[4:]
} }
} }
...@@ -3375,7 +3375,7 @@ func (p *AnswerLastTransaction) neoMsgDecode(data []byte) (int, error) { ...@@ -3375,7 +3375,7 @@ func (p *AnswerLastTransaction) neoMsgDecode(data []byte) (int, error) {
if len(data) < 8 { if len(data) < 8 {
goto overflow goto overflow
} }
p.Tid = zodb.Tid(binary.BigEndian.Uint64(data[0:])) p.Tid = zodb.Tid(binary.BigEndian.Uint64(data[0 : 0+8]))
return 8, nil return 8, nil
overflow: overflow:
...@@ -3402,9 +3402,9 @@ func (p *CheckCurrentSerial) neoMsgDecode(data []byte) (int, error) { ...@@ -3402,9 +3402,9 @@ func (p *CheckCurrentSerial) neoMsgDecode(data []byte) (int, error) {
if len(data) < 24 { if len(data) < 24 {
goto overflow goto overflow
} }
p.Tid = zodb.Tid(binary.BigEndian.Uint64(data[0:])) p.Tid = zodb.Tid(binary.BigEndian.Uint64(data[0 : 0+8]))
p.Oid = zodb.Oid(binary.BigEndian.Uint64(data[8:])) p.Oid = zodb.Oid(binary.BigEndian.Uint64(data[8 : 8+8]))
p.Serial = zodb.Tid(binary.BigEndian.Uint64(data[16:])) p.Serial = zodb.Tid(binary.BigEndian.Uint64(data[16 : 16+8]))
return 24, nil return 24, nil
overflow: overflow:
...@@ -3429,7 +3429,7 @@ func (p *AnswerCheckCurrentSerial) neoMsgDecode(data []byte) (int, error) { ...@@ -3429,7 +3429,7 @@ func (p *AnswerCheckCurrentSerial) neoMsgDecode(data []byte) (int, error) {
if len(data) < 8 { if len(data) < 8 {
goto overflow goto overflow
} }
p.AnswerStoreObject.Conflict = zodb.Tid(binary.BigEndian.Uint64(data[0:])) p.AnswerStoreObject.Conflict = zodb.Tid(binary.BigEndian.Uint64(data[0 : 0+8]))
return 8, nil return 8, nil
overflow: overflow:
...@@ -3455,8 +3455,8 @@ func (p *NotifyTransactionFinished) neoMsgDecode(data []byte) (int, error) { ...@@ -3455,8 +3455,8 @@ func (p *NotifyTransactionFinished) neoMsgDecode(data []byte) (int, error) {
if len(data) < 16 { if len(data) < 16 {
goto overflow goto overflow
} }
p.TTID = zodb.Tid(binary.BigEndian.Uint64(data[0:])) p.TTID = zodb.Tid(binary.BigEndian.Uint64(data[0 : 0+8]))
p.MaxTID = zodb.Tid(binary.BigEndian.Uint64(data[8:])) p.MaxTID = zodb.Tid(binary.BigEndian.Uint64(data[8 : 8+8]))
return 16, nil return 16, nil
overflow: overflow:
...@@ -3514,9 +3514,9 @@ func (p *Replicate) neoMsgDecode(data []byte) (int, error) { ...@@ -3514,9 +3514,9 @@ func (p *Replicate) neoMsgDecode(data []byte) (int, error) {
if len(data) < 12 { if len(data) < 12 {
goto overflow goto overflow
} }
p.Tid = zodb.Tid(binary.BigEndian.Uint64(data[0:])) p.Tid = zodb.Tid(binary.BigEndian.Uint64(data[0 : 0+8]))
{ {
l := binary.BigEndian.Uint32(data[8:]) l := binary.BigEndian.Uint32(data[8 : 8+4])
data = data[12:] data = data[12:]
if uint64(len(data)) < 4+uint64(l) { if uint64(len(data)) < 4+uint64(l) {
goto overflow goto overflow
...@@ -3526,7 +3526,7 @@ func (p *Replicate) neoMsgDecode(data []byte) (int, error) { ...@@ -3526,7 +3526,7 @@ func (p *Replicate) neoMsgDecode(data []byte) (int, error) {
data = data[l:] data = data[l:]
} }
{ {
l := binary.BigEndian.Uint32(data[0:]) l := binary.BigEndian.Uint32(data[0 : 0+4])
data = data[4:] data = data[4:]
p.SourceDict = make(map[uint32]string, l) p.SourceDict = make(map[uint32]string, l)
m := p.SourceDict m := p.SourceDict
...@@ -3534,9 +3534,9 @@ func (p *Replicate) neoMsgDecode(data []byte) (int, error) { ...@@ -3534,9 +3534,9 @@ func (p *Replicate) neoMsgDecode(data []byte) (int, error) {
if len(data) < 8 { if len(data) < 8 {
goto overflow goto overflow
} }
key := binary.BigEndian.Uint32(data[0:]) key := binary.BigEndian.Uint32(data[0 : 0+4])
{ {
l := binary.BigEndian.Uint32(data[4:]) l := binary.BigEndian.Uint32(data[4 : 4+4])
data = data[8:] data = data[8:]
if uint64(len(data)) < uint64(l) { if uint64(len(data)) < uint64(l) {
goto overflow goto overflow
...@@ -3573,8 +3573,8 @@ func (p *ReplicationDone) neoMsgDecode(data []byte) (int, error) { ...@@ -3573,8 +3573,8 @@ func (p *ReplicationDone) neoMsgDecode(data []byte) (int, error) {
if len(data) < 12 { if len(data) < 12 {
goto overflow goto overflow
} }
p.Offset = binary.BigEndian.Uint32(data[0:]) p.Offset = binary.BigEndian.Uint32(data[0 : 0+4])
p.Tid = zodb.Tid(binary.BigEndian.Uint64(data[4:])) p.Tid = zodb.Tid(binary.BigEndian.Uint64(data[4 : 4+8]))
return 12, nil return 12, nil
overflow: overflow:
...@@ -3613,12 +3613,12 @@ func (p *FetchTransactions) neoMsgDecode(data []byte) (int, error) { ...@@ -3613,12 +3613,12 @@ func (p *FetchTransactions) neoMsgDecode(data []byte) (int, error) {
if len(data) < 28 { if len(data) < 28 {
goto overflow goto overflow
} }
p.Partition = binary.BigEndian.Uint32(data[0:]) p.Partition = binary.BigEndian.Uint32(data[0 : 0+4])
p.Length = binary.BigEndian.Uint32(data[4:]) p.Length = binary.BigEndian.Uint32(data[4 : 4+4])
p.MinTid = zodb.Tid(binary.BigEndian.Uint64(data[8:])) p.MinTid = zodb.Tid(binary.BigEndian.Uint64(data[8 : 8+8]))
p.MaxTid = zodb.Tid(binary.BigEndian.Uint64(data[16:])) p.MaxTid = zodb.Tid(binary.BigEndian.Uint64(data[16 : 16+8]))
{ {
l := binary.BigEndian.Uint32(data[24:]) l := binary.BigEndian.Uint32(data[24 : 24+4])
data = data[28:] data = data[28:]
if uint64(len(data)) < uint64(l)*8 { if uint64(len(data)) < uint64(l)*8 {
goto overflow goto overflow
...@@ -3627,7 +3627,7 @@ func (p *FetchTransactions) neoMsgDecode(data []byte) (int, error) { ...@@ -3627,7 +3627,7 @@ func (p *FetchTransactions) neoMsgDecode(data []byte) (int, error) {
p.TxnKnownList = make([]zodb.Tid, l) p.TxnKnownList = make([]zodb.Tid, l)
for i := 0; uint32(i) < l; i++ { for i := 0; uint32(i) < l; i++ {
a := &p.TxnKnownList[i] a := &p.TxnKnownList[i]
(*a) = zodb.Tid(binary.BigEndian.Uint64(data[0:])) (*a) = zodb.Tid(binary.BigEndian.Uint64(data[0 : 0+8]))
data = data[8:] data = data[8:]
} }
} }
...@@ -3667,10 +3667,10 @@ func (p *AnswerFetchTransactions) neoMsgDecode(data []byte) (int, error) { ...@@ -3667,10 +3667,10 @@ func (p *AnswerFetchTransactions) neoMsgDecode(data []byte) (int, error) {
if len(data) < 20 { if len(data) < 20 {
goto overflow goto overflow
} }
p.PackTid = zodb.Tid(binary.BigEndian.Uint64(data[0:])) p.PackTid = zodb.Tid(binary.BigEndian.Uint64(data[0 : 0+8]))
p.NextTid = zodb.Tid(binary.BigEndian.Uint64(data[8:])) p.NextTid = zodb.Tid(binary.BigEndian.Uint64(data[8 : 8+8]))
{ {
l := binary.BigEndian.Uint32(data[16:]) l := binary.BigEndian.Uint32(data[16 : 16+4])
data = data[20:] data = data[20:]
if uint64(len(data)) < uint64(l)*8 { if uint64(len(data)) < uint64(l)*8 {
goto overflow goto overflow
...@@ -3679,7 +3679,7 @@ func (p *AnswerFetchTransactions) neoMsgDecode(data []byte) (int, error) { ...@@ -3679,7 +3679,7 @@ func (p *AnswerFetchTransactions) neoMsgDecode(data []byte) (int, error) {
p.TxnDeleteList = make([]zodb.Tid, l) p.TxnDeleteList = make([]zodb.Tid, l)
for i := 0; uint32(i) < l; i++ { for i := 0; uint32(i) < l; i++ {
a := &p.TxnDeleteList[i] a := &p.TxnDeleteList[i]
(*a) = zodb.Tid(binary.BigEndian.Uint64(data[0:])) (*a) = zodb.Tid(binary.BigEndian.Uint64(data[0 : 0+8]))
data = data[8:] data = data[8:]
} }
} }
...@@ -3740,13 +3740,13 @@ func (p *FetchObjects) neoMsgDecode(data []byte) (int, error) { ...@@ -3740,13 +3740,13 @@ func (p *FetchObjects) neoMsgDecode(data []byte) (int, error) {
if len(data) < 36 { if len(data) < 36 {
goto overflow goto overflow
} }
p.Partition = binary.BigEndian.Uint32(data[0:]) p.Partition = binary.BigEndian.Uint32(data[0 : 0+4])
p.Length = binary.BigEndian.Uint32(data[4:]) p.Length = binary.BigEndian.Uint32(data[4 : 4+4])
p.MinTid = zodb.Tid(binary.BigEndian.Uint64(data[8:])) p.MinTid = zodb.Tid(binary.BigEndian.Uint64(data[8 : 8+8]))
p.MaxTid = zodb.Tid(binary.BigEndian.Uint64(data[16:])) p.MaxTid = zodb.Tid(binary.BigEndian.Uint64(data[16 : 16+8]))
p.MinOid = zodb.Oid(binary.BigEndian.Uint64(data[24:])) p.MinOid = zodb.Oid(binary.BigEndian.Uint64(data[24 : 24+8]))
{ {
l := binary.BigEndian.Uint32(data[32:]) l := binary.BigEndian.Uint32(data[32 : 32+4])
data = data[36:] data = data[36:]
p.ObjKnownDict = make(map[zodb.Tid][]zodb.Oid, l) p.ObjKnownDict = make(map[zodb.Tid][]zodb.Oid, l)
m := p.ObjKnownDict m := p.ObjKnownDict
...@@ -3754,10 +3754,10 @@ func (p *FetchObjects) neoMsgDecode(data []byte) (int, error) { ...@@ -3754,10 +3754,10 @@ func (p *FetchObjects) neoMsgDecode(data []byte) (int, error) {
if len(data) < 12 { if len(data) < 12 {
goto overflow goto overflow
} }
key := zodb.Tid(binary.BigEndian.Uint64(data[0:])) key := zodb.Tid(binary.BigEndian.Uint64(data[0 : 0+8]))
var v []zodb.Oid var v []zodb.Oid
{ {
l := binary.BigEndian.Uint32(data[8:]) l := binary.BigEndian.Uint32(data[8 : 8+4])
data = data[12:] data = data[12:]
if uint64(len(data)) < uint64(l)*8 { if uint64(len(data)) < uint64(l)*8 {
goto overflow goto overflow
...@@ -3766,7 +3766,7 @@ func (p *FetchObjects) neoMsgDecode(data []byte) (int, error) { ...@@ -3766,7 +3766,7 @@ func (p *FetchObjects) neoMsgDecode(data []byte) (int, error) {
v = make([]zodb.Oid, l) v = make([]zodb.Oid, l)
for i := 0; uint32(i) < l; i++ { for i := 0; uint32(i) < l; i++ {
a := &v[i] a := &v[i]
(*a) = zodb.Oid(binary.BigEndian.Uint64(data[0:])) (*a) = zodb.Oid(binary.BigEndian.Uint64(data[0 : 0+8]))
data = data[8:] data = data[8:]
} }
} }
...@@ -3829,11 +3829,11 @@ func (p *AnswerFetchObjects) neoMsgDecode(data []byte) (int, error) { ...@@ -3829,11 +3829,11 @@ func (p *AnswerFetchObjects) neoMsgDecode(data []byte) (int, error) {
if len(data) < 28 { if len(data) < 28 {
goto overflow goto overflow
} }
p.PackTid = zodb.Tid(binary.BigEndian.Uint64(data[0:])) p.PackTid = zodb.Tid(binary.BigEndian.Uint64(data[0 : 0+8]))
p.NextTid = zodb.Tid(binary.BigEndian.Uint64(data[8:])) p.NextTid = zodb.Tid(binary.BigEndian.Uint64(data[8 : 8+8]))
p.NextOid = zodb.Oid(binary.BigEndian.Uint64(data[16:])) p.NextOid = zodb.Oid(binary.BigEndian.Uint64(data[16 : 16+8]))
{ {
l := binary.BigEndian.Uint32(data[24:]) l := binary.BigEndian.Uint32(data[24 : 24+4])
data = data[28:] data = data[28:]
p.ObjDeleteDict = make(map[zodb.Tid][]zodb.Oid, l) p.ObjDeleteDict = make(map[zodb.Tid][]zodb.Oid, l)
m := p.ObjDeleteDict m := p.ObjDeleteDict
...@@ -3841,10 +3841,10 @@ func (p *AnswerFetchObjects) neoMsgDecode(data []byte) (int, error) { ...@@ -3841,10 +3841,10 @@ func (p *AnswerFetchObjects) neoMsgDecode(data []byte) (int, error) {
if len(data) < 12 { if len(data) < 12 {
goto overflow goto overflow
} }
key := zodb.Tid(binary.BigEndian.Uint64(data[0:])) key := zodb.Tid(binary.BigEndian.Uint64(data[0 : 0+8]))
var v []zodb.Oid var v []zodb.Oid
{ {
l := binary.BigEndian.Uint32(data[8:]) l := binary.BigEndian.Uint32(data[8 : 8+4])
data = data[12:] data = data[12:]
if uint64(len(data)) < uint64(l)*8 { if uint64(len(data)) < uint64(l)*8 {
goto overflow goto overflow
...@@ -3853,7 +3853,7 @@ func (p *AnswerFetchObjects) neoMsgDecode(data []byte) (int, error) { ...@@ -3853,7 +3853,7 @@ func (p *AnswerFetchObjects) neoMsgDecode(data []byte) (int, error) {
v = make([]zodb.Oid, l) v = make([]zodb.Oid, l)
for i := 0; uint32(i) < l; i++ { for i := 0; uint32(i) < l; i++ {
a := &v[i] a := &v[i]
(*a) = zodb.Oid(binary.BigEndian.Uint64(data[0:])) (*a) = zodb.Oid(binary.BigEndian.Uint64(data[0 : 0+8]))
data = data[8:] data = data[8:]
} }
} }
...@@ -3919,9 +3919,9 @@ func (p *AddTransaction) neoMsgDecode(data []byte) (int, error) { ...@@ -3919,9 +3919,9 @@ func (p *AddTransaction) neoMsgDecode(data []byte) (int, error) {
if len(data) < 12 { if len(data) < 12 {
goto overflow goto overflow
} }
p.Tid = zodb.Tid(binary.BigEndian.Uint64(data[0:])) p.Tid = zodb.Tid(binary.BigEndian.Uint64(data[0 : 0+8]))
{ {
l := binary.BigEndian.Uint32(data[8:]) l := binary.BigEndian.Uint32(data[8 : 8+4])
data = data[12:] data = data[12:]
if uint64(len(data)) < 4+uint64(l) { if uint64(len(data)) < 4+uint64(l) {
goto overflow goto overflow
...@@ -3931,7 +3931,7 @@ func (p *AddTransaction) neoMsgDecode(data []byte) (int, error) { ...@@ -3931,7 +3931,7 @@ func (p *AddTransaction) neoMsgDecode(data []byte) (int, error) {
data = data[l:] data = data[l:]
} }
{ {
l := binary.BigEndian.Uint32(data[0:]) l := binary.BigEndian.Uint32(data[0 : 0+4])
data = data[4:] data = data[4:]
if uint64(len(data)) < 4+uint64(l) { if uint64(len(data)) < 4+uint64(l) {
goto overflow goto overflow
...@@ -3941,7 +3941,7 @@ func (p *AddTransaction) neoMsgDecode(data []byte) (int, error) { ...@@ -3941,7 +3941,7 @@ func (p *AddTransaction) neoMsgDecode(data []byte) (int, error) {
data = data[l:] data = data[l:]
} }
{ {
l := binary.BigEndian.Uint32(data[0:]) l := binary.BigEndian.Uint32(data[0 : 0+4])
data = data[4:] data = data[4:]
if uint64(len(data)) < 13+uint64(l) { if uint64(len(data)) < 13+uint64(l) {
goto overflow goto overflow
...@@ -3950,10 +3950,10 @@ func (p *AddTransaction) neoMsgDecode(data []byte) (int, error) { ...@@ -3950,10 +3950,10 @@ func (p *AddTransaction) neoMsgDecode(data []byte) (int, error) {
p.Extension = string(data[:l]) p.Extension = string(data[:l])
data = data[l:] data = data[l:]
} }
p.Packed = byte2bool((data[0:])[0]) p.Packed = byte2bool((data[0 : 0+1])[0])
p.TTid = zodb.Tid(binary.BigEndian.Uint64(data[1:])) p.TTid = zodb.Tid(binary.BigEndian.Uint64(data[1 : 1+8]))
{ {
l := binary.BigEndian.Uint32(data[9:]) l := binary.BigEndian.Uint32(data[9 : 9+4])
data = data[13:] data = data[13:]
if uint64(len(data)) < uint64(l)*8 { if uint64(len(data)) < uint64(l)*8 {
goto overflow goto overflow
...@@ -3962,7 +3962,7 @@ func (p *AddTransaction) neoMsgDecode(data []byte) (int, error) { ...@@ -3962,7 +3962,7 @@ func (p *AddTransaction) neoMsgDecode(data []byte) (int, error) {
p.OidList = make([]zodb.Oid, l) p.OidList = make([]zodb.Oid, l)
for i := 0; uint32(i) < l; i++ { for i := 0; uint32(i) < l; i++ {
a := &p.OidList[i] a := &p.OidList[i]
(*a) = zodb.Oid(binary.BigEndian.Uint64(data[0:])) (*a) = zodb.Oid(binary.BigEndian.Uint64(data[0 : 0+8]))
data = data[8:] data = data[8:]
} }
} }
...@@ -4002,12 +4002,12 @@ func (p *AddObject) neoMsgDecode(data []byte) (int, error) { ...@@ -4002,12 +4002,12 @@ func (p *AddObject) neoMsgDecode(data []byte) (int, error) {
if len(data) < 41 { if len(data) < 41 {
goto overflow goto overflow
} }
p.Oid = zodb.Oid(binary.BigEndian.Uint64(data[0:])) p.Oid = zodb.Oid(binary.BigEndian.Uint64(data[0 : 0+8]))
p.Serial = zodb.Tid(binary.BigEndian.Uint64(data[8:])) p.Serial = zodb.Tid(binary.BigEndian.Uint64(data[8 : 8+8]))
p.Compression = byte2bool((data[16:])[0]) p.Compression = byte2bool((data[16 : 16+1])[0])
copy(p.Checksum[:], data[17:37]) copy(p.Checksum[:], data[17:37])
{ {
l := binary.BigEndian.Uint32(data[37:]) l := binary.BigEndian.Uint32(data[37 : 37+4])
data = data[41:] data = data[41:]
if uint64(len(data)) < 8+uint64(l) { if uint64(len(data)) < 8+uint64(l) {
goto overflow goto overflow
...@@ -4017,7 +4017,7 @@ func (p *AddObject) neoMsgDecode(data []byte) (int, error) { ...@@ -4017,7 +4017,7 @@ func (p *AddObject) neoMsgDecode(data []byte) (int, error) {
copy(p.Data, data[:l]) copy(p.Data, data[:l])
data = data[l:] data = data[l:]
} }
p.DataSerial = zodb.Tid(binary.BigEndian.Uint64(data[0:])) p.DataSerial = zodb.Tid(binary.BigEndian.Uint64(data[0 : 0+8]))
return 41 + int(nread), nil return 41 + int(nread), nil
overflow: overflow:
...@@ -4042,7 +4042,7 @@ func (p *Truncate) neoMsgDecode(data []byte) (int, error) { ...@@ -4042,7 +4042,7 @@ func (p *Truncate) neoMsgDecode(data []byte) (int, error) {
if len(data) < 8 { if len(data) < 8 {
goto overflow goto overflow
} }
p.Tid = zodb.Tid(binary.BigEndian.Uint64(data[0:])) p.Tid = zodb.Tid(binary.BigEndian.Uint64(data[0 : 0+8]))
return 8, nil return 8, nil
overflow: overflow:
......
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