You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
LLVM closure cells lay out an over-aligned capture (§16.4) at LLVM's alignment, not TypeLayout's #2042
Found with #2039. let held = Al { a: 5, v: 3 } (@[align(32)] v) captured by move () => (&raw const held.v as i64) % 32 reads false: the owned heap cell {drop_fn, clone_fn, env} (CodegenDispatch, closure owned_cell path and the env clone fn) is allocated with with_alloc(abi_size_of(cell_ty)) and its literal LLVM struct places env, and Al inside the capture struct, at LLVM's ABI alignment (Al's i8-padded body reports 8), not the model's 32. Expected: the cell and capture struct take TypeLayout's alignment, as tuples do since #1964 (tuple_type_from_layout), and the cell is allocated with with_alloc_aligned (#2039). The C backend's cells are already correct after #2039 (with_alloc_aligned of sizeof/_Alignof of a cell whose records carry _Alignas).
Fixed on fix-2036 (PR #2044, commit 0577d56). Closure and async environments now take TypeLayout's tuple placement, and the owned cell puts the environment at its own alignment. The cell, its clone and async environments are allocated with with_alloc_aligned. Fixture: behav_2042_closure_env_over_aligned.
Activity
Closure and async environments take TypeLayout's placement; their cel…
ehartford commentedon Oct 3, 2026
Fixed on fix-2036 (PR #2044, commit 0577d56). Closure and async environments now take TypeLayout's tuple placement, and the owned cell puts the environment at its own alignment. The cell, its clone and async environments are allocated with with_alloc_aligned. Fixture: behav_2042_closure_env_over_aligned.
emit-C nullable-pointer Options (#2036); over-aligned heap cells and …
ehartford commentedon Oct 3, 2026
Fixed on main (stack #2045: #2037 + #2044; seed-driven battery GREEN on 0577d56, tree identical to main).