Skip to content

Conversation

@jevansaks
Copy link
Member

When we have multiple buffer params that all have their size described by one count parameter, the implementation is ending up with the last one passed in as the length. It also asserts that all buffers have the same length.

This assert is wrong and should only fire if both buffers are non-empty and have different length. Also this logic error highlights the problem that the length we choose to pass to native is also wrong when you pass some shared params as null and others as non-null. So I also updated the generated code to build up an expression for the length based on all the spans like (span1.IsEmpty ? span2.Length : span1.Length).

Fixes #1560

@jevansaks jevansaks requested a review from manodasanW November 25, 2025 01:48
@jevansaks jevansaks merged commit d531fc7 into main Nov 25, 2025
7 checks passed
@jevansaks jevansaks deleted the user/jevansaks/optionalarraycountparams branch November 25, 2025 03:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The friendly wrapper for UpdateProcThreadAttribute() is impossible to use now.

3 participants