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
validate-ownership accepts a drop of a temp that is Uninit on one incoming path (Maybe conflates maybe-moved with maybe-uninit) #1559
Found while implementing D61 (#1480). A synthesized enum formatter registered its per-arm formatted-payload temps in one statement frame and dropped them at the join; on the arm that never initialized the temp the drop freed stack garbage (with run of test/behavior/derive_enum_debug_clone.w: invalid free addr=... panic: invalid free: pointer is not an allocated payload start).
--validate-all said ok and --dump-drop-plan classified the drop as
i.e. Uninit on one edge, Init on the other, joined to Maybe, and Maybe is treated as a guarded (reset-on-move) drop. A local that was never assigned on a path is not null-blanked — LLVM allocas are not zero-initialized — so the guard does not protect it. #1111 made a pure Uninit drop invalid; the Uninit-on-some-path case still passes. This is the lattice gap #1414 describes (maybe-moved vs maybe-uninit need to stay distinct).
The lowering bug is fixed in the D61 PR (each arm gets its own frame); the validator gap remains.
Activity
Sema, MIR: a body that is no block is its own scope — a `let` in a on…
validate-ownership: a drop that reaches a path where the place holds …
Ownership: D72 liveness byte, D73 assignment-as-read, validator leak/…
MirCore: the ownership validator refuses a read of a local on a path …
Globals: a call, dyn dispatch, stored callable or drop that writes a …