-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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 #34377. Fixes #34378. Fixes #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: imhameed <imhameed@users.noreply.github.com>
- Loading branch information
1 parent
01a08fe
commit 86940e1
Showing
3 changed files
with
212 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters