mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-27 06:43:19 +08:00
A shape union's arms all carry a collector header when one of them does. The emitter applied that rule in one pass over the unions in module order, so a header that a later union gave a shared arm did not reach the other arms of an earlier union. With First = A | B and Second = B | C, where only C is cyclic, B got a header through Second, First's trace helper then called A's trace function, and A had none: the module failed LLVM verification with "use of undefined value '@sc_rtrace_r0'". The rule now repeats until no union adds a header. Corpus 5919-record-unions-shared-arms chains Third = D | A, First = A | B and Second = B | C, so the requirement passes from Second through First to Third.