https://bugs.winehq.org/show_bug.cgi?id=55736
--- Comment #19 from Esme Povirk madewokherd@gmail.com --- I think this is the original code: https://github.com/dotnet/runtime/blob/main/src/coreclr/utilcode/prettyprint...
It looks much the same as Mono's version, complete with the lack of bounds checking, but they allocate the arrays with a size of rank, not the actual sizes, zero the array, and then only assign the values that are in range. So *effectively* this is the same as bounds-checking i within the loop.
Also, it seems they do ignore a lower-bound set explicitly to 0, which seems like a bug to me, but since this is getting hashed to produce a COM interface GUID, we have to preserve the bug.
I made a pull request: https://github.com/madewokherd/mono/pull/57