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
Intern-pool text views held across interning: an audit for the shape #1323
From PR #1322. InternPool.resolve / Sema.pool_resolve return &str — a view into symbol_texts: Vec[str]. A binding of that view is dangling as soon as anything interns a new symbol (the table grows and the old buffer is freed). The derive generators did exactly that and the release compiler segfaulted on test/behavior/derive_enum_debug_clone.w (lldb: ldp x8, x9, [x20] on the freed type_name view in Sema.ct_generate_debug_derive). Only the current compiler generation exposes it: the pinned seed lowers such a let as a header copy, the current one as a true D27 view — so a stage1 built by the seed is blind to the class.
#1322 owns the 17 bindings in src/ComptimeTransform.w. The same shape appears elsewhere (counts of let x = self.pool_resolve[_symbol](sym) / intern.resolve(sym) at the end of a line): SemaCheck.w 70, Sema.w 24, SemaDecl.w 18, SemaDiag.w 3, CodegenDispatch.w 28, Codegen.w 25, CodegenTraits.w 16, Parser.w 9, Lsp.w 3. Most never intern before their last use, but nothing verifies that, and a blind .clone() sweep is the wrong fix (allocation on every hot path).
Wanted: a check that flags a pool-text view live across a call that can intern (with analyze fact over the live MIR call graph: view binding from resolve* whose scope contains a path:call to intern_str), so the remaining sites are classified by evidence and only the real ones are owned.
Activity
analyze: audit:pool-views finds a pool view read after the pool may h…
Ast: impl_type_params_start/count and impl_trait_type_args_start/coun…
ComptimeEval: own the pool texts held across evaluation (#1323)
SemaCheck: own the pool texts held across checking (#1323)
SemaDecl: own the pool texts held across collection (#1323)
Codegen: declare_extern_fn owns name_str across compute_fn_abi (#1323)
CodegenDispatch: the inline-asm constraint text is owned across resol…
CodegenTraits: own the vtable names held across interning (#1323)
analyze: audit:pool-views catches intern-pool views held across inter…