diff options
author | Björn Harrtell <bjornharrtell@users.noreply.github.com> | 2021-02-23 18:34:20 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-23 09:34:20 -0800 |
commit | cbbbaa61b34c31f17773c2fef354c31664e9562e (patch) | |
tree | fcd7e13a98f401046c37835a3c0bf0cf1a4f6f65 /src | |
parent | ffc2ef77caeb6b04e89db952c65216982db44698 (diff) | |
download | flatbuffers-cbbbaa61b34c31f17773c2fef354c31664e9562e.tar.gz flatbuffers-cbbbaa61b34c31f17773c2fef354c31664e9562e.tar.bz2 flatbuffers-cbbbaa61b34c31f17773c2fef354c31664e9562e.zip |
[C#] Fix truncated ArraySegment<byte> if elementSize != 1 (#6462)
* WIP: Fix returned truncated ArraySegment<byte> if elementSize is not byte
* Fix
* Regenerated test code
Diffstat (limited to 'src')
-rw-r--r-- | src/idl_gen_csharp.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/idl_gen_csharp.cpp b/src/idl_gen_csharp.cpp index a5423a23..fed1169f 100644 --- a/src/idl_gen_csharp.cpp +++ b/src/idl_gen_csharp.cpp @@ -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"; |