Commit Graph

2 Commits

Author SHA1 Message Date
Erik Eckstein
c142e36073 tests: add a missing REQUIRES: executable_test in SILOptimizer/stack-promotion-crash.swift
rdar://131519168
2024-07-11 09:56:28 +02:00
Erik Eckstein
6ed2489aee 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
2024-07-04 17:03:31 +02:00