[mono] Fix multidimensional array construction when using programmer-specified...
[mono] Fix multidimensional array construction when using programmer-specified lower bounds. (#35091) * [mono] Fix multidimensional array construction when using programmer-specified lower bounds. mono_array_full_new_checked and mono_array_full_new (which is marked as a MONO_API function) both take two pointers to buffers containing lengths and lower bounds. mono_array_new_n_icall can split the incoming parameter list in two before forwarding the results to mono_array_full_new_checked, so mono_array_full_new_checked was receiving two buffers containing interleaved lower bounds and lengths. ECMA-335 states that array constructors that specify both lower bounds and lengths interleave these values. Deinterleave these in method_to_ir. Add some tests to iltests.il that verify that multidimensional arrays with custom lower bounds work. Fixes https://github.com/dotnet/runtime/issues/34377. Fixes https://github.com/dotnet/runtime/issues/34378. Fixes https://github.com/dotnet/runtime/issues/34381. * Deinterleave lower bounds and array lengths in the interpreter. Also make the condition in which the deinterleaving code path is taken more precise. Perhaps this branch should be marked as unlikely. * Fix a typo. Co-authored-by: Nimhameed <imhameed@users.noreply.github.com>
Showing
想要评论请 注册 或 登录