Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public bool TryGet(int i, out IMessagePackFormatter? formatter)
//which does a full fence and then checks state.
//Shouldn't happen much and only on startup...
var f = _formatters;
if (i > f.Length)
if (i >= f.Length)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are going to index into an array based on this check...

I am somewhat surprised that we haven't seen this come up as an issue filed on the lib...

That said there are possibly times where this could result in transient failures; i.e. if you had 257 types, it's possible the 256'th would transiently fail, but once the 257'th got loaded, the 256th type would be good to go again...

{
formatter = default;
return false;
Expand Down
Loading