Fix generated EndVector. (#6385)

This commit is contained in:
Richard A Hofer 2021-01-05 17:45:23 -05:00 committed by GitHub
parent 1bf1ec0270
commit 4363c1d2cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -628,7 +628,7 @@ class PythonGenerator : public BaseGenerator {
code += Indent + "builder.head = builder.head - len(bytes)\n"; code += Indent + "builder.head = builder.head - len(bytes)\n";
code += Indent + "builder.Bytes[builder.head : builder.head + len(bytes)]"; code += Indent + "builder.Bytes[builder.head : builder.head + len(bytes)]";
code += " = bytes\n"; code += " = bytes\n";
code += Indent + "return builder.EndVector(len(bytes))\n"; code += Indent + "return builder.EndVector()\n";
} }
// Get the offset of the end of a table. // Get the offset of the end of a table.

View File

@ -785,7 +785,7 @@ def MonsterMakeTestnestedflatbufferVectorFromBytes(builder, bytes):
builder.StartVector(1, len(bytes), 1) builder.StartVector(1, len(bytes), 1)
builder.head = builder.head - len(bytes) builder.head = builder.head - len(bytes)
builder.Bytes[builder.head : builder.head + len(bytes)] = bytes builder.Bytes[builder.head : builder.head + len(bytes)] = bytes
return builder.EndVector(len(bytes)) return builder.EndVector()
def MonsterAddTestempty(builder, testempty): builder.PrependUOffsetTRelativeSlot(14, flatbuffers.number_types.UOffsetTFlags.py_type(testempty), 0) def MonsterAddTestempty(builder, testempty): builder.PrependUOffsetTRelativeSlot(14, flatbuffers.number_types.UOffsetTFlags.py_type(testempty), 0)
def MonsterAddTestbool(builder, testbool): builder.PrependBoolSlot(15, testbool, 0) def MonsterAddTestbool(builder, testbool): builder.PrependBoolSlot(15, testbool, 0)
def MonsterAddTesthashs32Fnv1(builder, testhashs32Fnv1): builder.PrependInt32Slot(16, testhashs32Fnv1, 0) def MonsterAddTesthashs32Fnv1(builder, testhashs32Fnv1): builder.PrependInt32Slot(16, testhashs32Fnv1, 0)
@ -840,7 +840,7 @@ def MonsterMakeTestrequirednestedflatbufferVectorFromBytes(builder, bytes):
builder.StartVector(1, len(bytes), 1) builder.StartVector(1, len(bytes), 1)
builder.head = builder.head - len(bytes) builder.head = builder.head - len(bytes)
builder.Bytes[builder.head : builder.head + len(bytes)] = bytes builder.Bytes[builder.head : builder.head + len(bytes)] = bytes
return builder.EndVector(len(bytes)) return builder.EndVector()
def MonsterEnd(builder): return builder.EndObject() def MonsterEnd(builder): return builder.EndObject()
import MyGame.Example.Ability import MyGame.Example.Ability