Skip to content

analyze src/main.w audit:all: CCodegen re-enters mutable Sema in the frozen phase (8 violations) #1983

Closed

Description

@ehartford

Found while working #1647 (D65). with analyze src/main.w audit:all is red on main 9307016 (stage1 built at that commit, seed per seed.lock), before any #1647 change, with 8 frozen-phase violations from the emit-c backend (CCodegen, #1766):

violation: frozen phase CCodegen.collect_used_struct_types -> Sema.push_specialization_subst: mutable Sema re-entry
violation: frozen phase CCodegen.collect_used_struct_types -> Sema.pop_generic_subst: mutable Sema re-entry
violation: frozen phase CCodegen.closure_env_kind_for -> Sema.type_layout_align_of: mutable Sema re-entry
violation: frozen phase CCodegen.closure_env_kind_for -> Sema.type_layout_size_of: mutable Sema re-entry
violation: frozen phase CCodegen.emit_closure_body -> Sema.push_specialization_subst: mutable Sema re-entry
violation: frozen phase CCodegen.emit_closure_body -> Sema.pop_generic_subst: mutable Sema re-entry
violation: frozen phase CCodegen.emit_fn_body -> Sema.push_specialization_subst: mutable Sema re-entry
violation: frozen phase CCodegen.emit_fn_body -> Sema.pop_generic_subst: mutable Sema re-entry
compiler-analysis-audit: facts=4105444 violations=13 FAILED

(The other 5 of the 13 are the LspDocument layout mismatch, filed separately.)

Repro: out/bootstrap/bin/with-stage1 analyze src/main.w audit:all on a 9307016 worktree. The LLVM backend reads these facts through the frozen Sema; the C backend pushes/pops a specialization substitution and asks layout through the mutable path. #1647 acceptance ("audit:all green over src/main.w") cannot be met until this is fixed.

Activity

  1. ehartford commented on Oct 3, 2026

    @ehartford
    ContributorAuthor

    Fixed on main by 0f0d76b (#2012, battery green on 6644771). audit:all over src/main.w: 13 violations → 0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions