Files
Erik Eckstein d64b3f12d5 LLVMSwiftAA: don't let field offset loads move above swift_allocObject
A direct field offset global of a class with a runtime-computed layout is zero
until the class metadata is initialized by the metadata accessor. But the
accessor call is marked as readnone and swift_allocObject is NoModRef in
SwiftAA. Therefore GVN's load PRE could move a load of the field offset global
above the accessor call and the allocation, which resulted in a field offset
of zero for the first allocated instance, overwriting the isa pointer.

Fix this by treating swift_allocObject as a write of non-constant field
offset globals: if an instance of the class exists, the metadata is
guaranteed to be initialized.

rdar://190169393
2026-10-23 09:24:31 +01:00
..