mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-01 19:58:15 +00:00
Fix generated EndVector. (#6385)
This commit is contained in:
@@ -628,7 +628,7 @@ class PythonGenerator : public BaseGenerator {
|
||||
code += Indent + "builder.head = builder.head - len(bytes)\n";
|
||||
code += Indent + "builder.Bytes[builder.head : builder.head + len(bytes)]";
|
||||
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.
|
||||
|
||||
@@ -785,7 +785,7 @@ def MonsterMakeTestnestedflatbufferVectorFromBytes(builder, bytes):
|
||||
builder.StartVector(1, len(bytes), 1)
|
||||
builder.head = builder.head - len(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 MonsterAddTestbool(builder, testbool): builder.PrependBoolSlot(15, testbool, 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.head = builder.head - len(bytes)
|
||||
builder.Bytes[builder.head : builder.head + len(bytes)] = bytes
|
||||
return builder.EndVector(len(bytes))
|
||||
return builder.EndVector()
|
||||
def MonsterEnd(builder): return builder.EndObject()
|
||||
|
||||
import MyGame.Example.Ability
|
||||
|
||||
Reference in New Issue
Block a user