[Mono] Fix support for nested structs with explicit layout (#61467)
authorSimon Rozsival <simon@rozsival.com>
Thu, 2 Dec 2021 13:08:32 +0000 (14:08 +0100)
committerGitHub <noreply@github.com>
Thu, 2 Dec 2021 13:08:32 +0000 (14:08 +0100)
commit64d127653b6100174d80ac36c89f660de224a6da
tree583644cd124a6ef178c4b956c2e1656b1560d591
parente4746f331496d9370d21ec68b74bece35f0a3e96
[Mono] Fix support for nested structs with explicit layout (#61467)

* Add test case for nested struct with explicit layout

* Add license

* Modify test

* Temporarily enable the test in the CI pipeline

* Allow running Mac Catalyst builds in App Sandbox

* Allow enabling app sandbox for the other Mac Catalyst sample

* Revert "Allow enabling app sandbox for the other Mac Catalyst sample"

This reverts commit 8c3c9f92daa47d1de844dbe897155d119415fb74.

* Revert "Allow running Mac Catalyst builds in App Sandbox"

This reverts commit 1e404165d1859bc9e25dbcdb0b4dc74a839dc708.

* Add more test cases

* WIP: First implementation of the recursive check

* Improve code

* Fix test case

* Add more test cases

* Unify test cases

* Bugfixes

* Remove test which behaves differently depending on the target platform

* Remove sequential layout test which behaves differently on Linux and on Windows

* Reorganize test cases

* Remove call to mono_class_setup_fields

* Fix embedding detection

* Fix layout validation for generic structs

* Remove unintentional change

* Revert temporary change to the runtime.yml pipeline

* Code clean-up

* Revert unrelated change

* Use getters instead of directly accessing MonoClass fields
13 files changed:
src/mono/mono/metadata/class-init.c
src/tests/Loader/classloader/explicitlayout/NestedStructs/case01.cs [new file with mode: 0644]
src/tests/Loader/classloader/explicitlayout/NestedStructs/case01.csproj [new file with mode: 0644]
src/tests/Loader/classloader/explicitlayout/NestedStructs/case02.cs [new file with mode: 0644]
src/tests/Loader/classloader/explicitlayout/NestedStructs/case02.csproj [new file with mode: 0644]
src/tests/Loader/classloader/explicitlayout/NestedStructs/case03.cs [new file with mode: 0644]
src/tests/Loader/classloader/explicitlayout/NestedStructs/case03.csproj [new file with mode: 0644]
src/tests/Loader/classloader/explicitlayout/NestedStructs/case04.cs [new file with mode: 0644]
src/tests/Loader/classloader/explicitlayout/NestedStructs/case04.csproj [new file with mode: 0644]
src/tests/Loader/classloader/explicitlayout/NestedStructs/case05.cs [new file with mode: 0644]
src/tests/Loader/classloader/explicitlayout/NestedStructs/case05.csproj [new file with mode: 0644]
src/tests/Loader/classloader/explicitlayout/misc/array_segment.cs [new file with mode: 0644]
src/tests/Loader/classloader/explicitlayout/misc/array_segment.csproj [new file with mode: 0644]