message-size-increase #3
@ -680,9 +680,6 @@ func (this *Generator) generateDecodeBranch(hash [16]byte, typ Type) (n int, err
|
||||
n += nn; if err != nil { return n, err }
|
||||
nn, err = this.generateErrorCheck()
|
||||
n += nn; if err != nil { return n, err }
|
||||
indexVar := this.newTemporaryVar("index")
|
||||
nn, err = this.iprintf("%s := 0\n", indexVar)
|
||||
n += nn; if err != nil { return n, err }
|
||||
|
||||
// validate header
|
||||
// TODO: here, validate that length is less than the
|
||||
@ -691,7 +688,7 @@ func (this *Generator) generateDecodeBranch(hash [16]byte, typ Type) (n int, err
|
||||
// problems
|
||||
|
||||
// read fields
|
||||
nn, err = this.iprintf("for %s = range int(%s) {\n", indexVar, lengthVar)
|
||||
nn, err = this.iprintf("for _ = range int(%s) {\n", lengthVar)
|
||||
n += nn; if err != nil { return n, err }
|
||||
this.push()
|
||||
// read field header
|
||||
@ -770,6 +767,8 @@ func (this *Generator) generateDecodeBranch(hash [16]byte, typ Type) (n int, err
|
||||
default: return n, fmt.Errorf("unexpected type: %T", typ)
|
||||
}
|
||||
|
||||
nn, err = this.iprintf("return n, nil\n")
|
||||
|
||||
this.pop()
|
||||
nn, err = this.iprintf("}\n")
|
||||
n += nn; if err != nil { return n, err }
|
||||
|
Loading…
x
Reference in New Issue
Block a user