message-size-increase #3

Open
sashakoshka wants to merge 209 commits from message-size-increase into main
Showing only changes of commit a99d4dee66 - Show all commits

View File

@ -680,9 +680,6 @@ func (this *Generator) generateDecodeBranch(hash [16]byte, typ Type) (n int, err
n += nn; if err != nil { return n, err } n += nn; if err != nil { return n, err }
nn, err = this.generateErrorCheck() nn, err = this.generateErrorCheck()
n += nn; if err != nil { return n, err } 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 // validate header
// TODO: here, validate that length is less than the // 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 // problems
// read fields // 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 } n += nn; if err != nil { return n, err }
this.push() this.push()
// read field header // 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) default: return n, fmt.Errorf("unexpected type: %T", typ)
} }
nn, err = this.iprintf("return n, nil\n")
this.pop() this.pop()
nn, err = this.iprintf("}\n") nn, err = this.iprintf("}\n")
n += nn; if err != nil { return n, err } n += nn; if err != nil { return n, err }