LLVMSharp
LLVMSharp copied to clipboard
Use the Count when converting a MarshaledArray to a ReadOnlySpan
I encountered an error when using BuildGEP saying there were some null elements being passed in.
The ArrayPool can sometimes return a larger array than what was requested, so was causing extra null elements to be passed into the function.
This PR should resolve the issue by setting the expected length of the array into the ReadOnlySpan which will act to limit the length.