[c#] Fix Table __vector_as_array correct len calc (#8911)

* fix for https://github.com/google/flatbuffers/issues/8759
__vector_as_array<T> calling ByteBuffer.ToArray<T> with the length in bytes by multiplying len with ByteBuffer.Sizeof<T> and FlatBuffersExampleTests extended to call GetVectorOfLongsArray/GetVectorOfDoublesArray which failed without the fix

* first try to repair build-dotnet-windows

* syntax error fixed

* Update solution creation command in build workflow

add --format sln to the dotnet new command, maybe it is currently creating a .slnx instead?
This commit is contained in:
Stefan F.
2026-02-04 13:13:01 +01:00
committed by GitHub
parent af8997b567
commit 95ff1f1d80
3 changed files with 16 additions and 5 deletions

View File

@@ -150,7 +150,7 @@ namespace Google.FlatBuffers
var pos = this.__vector(o);
var len = this.__vector_len(o);
return bb.ToArray<T>(pos, len);
return bb.ToArray<T>(pos, len * ByteBuffer.SizeOf<T>());
}
// Initialize any Table-derived type to point to the union at the given offset.