message-size-increase #3

Merged
sashakoshka merged 227 commits from message-size-increase into main 2025-09-07 19:27:38 -06:00
Showing only changes of commit ae79a32309 - Show all commits

View File

@ -343,7 +343,14 @@ func (this *Generator) generateEncodeValue(typ Type, valueSource, tagSource stri
case TypeBuffer: case TypeBuffer:
// SBA: <data: U8>* // SBA: <data: U8>*
// LBA: <length: UN> <data: U8>* // LBA: <length: UN> <data: U8>*
nn, err := this.iprintf("if %s.Is(tape.LBA) {\n", tagSource) nn, err := this.iprintf("if len(%s) > tape.MaxStructureLength {\n", valueSource)
n += nn; if err != nil { return n, err }
this.push()
nn, err = this.iprintf("return n, tape.ErrTooLong\n")
this.pop()
nn, err = this.iprintf("}\n")
n += nn; if err != nil { return n, err }
nn, err = this.iprintf("if %s.Is(tape.LBA) {\n", tagSource)
n += nn; if err != nil { return n, err } n += nn; if err != nil { return n, err }
this.push() this.push()
nn, err = this.iprintf( nn, err = this.iprintf(