swift
6ed2489a - IRGen: don't stack promote classes for which the layout has not a fixed size

Commit
1 year ago
IRGen: don't stack promote classes for which the layout has not a fixed size In most cases this was already checked with `ClassLayout::isFixedLayout`. But for classes which are imported from another module and contain implementation-only C-imported stored properties, those properties don't show up in the class layout. Stack promoting such classes will reserve too less space on the stack which leads to all kind of memory corruption problems. The fix is to also check `ClassLayout::isFixedSize`, which returns false for such classes. Fixes a miscompile rdar://131067105
Author
Parents
Loading