mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
In C++, a primary base class that is placed in the beginning of the type's memory layout isn't always the type that is the first in the list of bases – the base types might be laid out in memory in a different order. This makes sure that IRGen handles base types of C++ structs in the correct order. This fixes an assertion in asserts-enabled compilers, and an out-of-memory error in asserts-disabled compilers. The issue was happening for both value types and foreign reference types. This change also includes a small refactoring to reuse the logic between the two code paths. rdar://140848603
119 KiB
119 KiB