[C#] Fix truncated ArraySegment<byte> if elementSize != 1 (#6462)

* WIP: Fix returned truncated ArraySegment<byte> if elementSize is not byte

* Fix

* Regenerated test code
This commit is contained in:
Björn Harrtell
2021-02-23 18:34:20 +01:00
committed by GitHub
parent ffc2ef77ca
commit cbbbaa61b3
7 changed files with 24 additions and 19 deletions

View File

@@ -845,6 +845,8 @@ class CSharpGenerator : public BaseGenerator {
code += "Bytes() { return ";
code += "__p.__vector_as_arraysegment(";
code += NumToString(field.value.offset);
code +=
", " + NumToString(SizeOf(field.value.type.VectorType().base_type));
code += "); }\n";
code += "#endif\n";