Skip to content

Migrator erases named record types with leading underscores to c_void #1124

Closed

Description

@ehartford

The first Phase 1 migration of c-algorithms fails on HashTablePair pair = {HASH_TABLE_KEY_NULL, HASH_TABLE_NULL} in hash_table_iter_next.

Pinned upstream: fragglet/c-algorithms at
23d453792ed89a28ed7d2c8d4311a4d9f7822edd. The codeload tarball SHA256 is
c2e9f3ba13d5373f79a70fa27d93730de98af314f2476190b156eee2a638a51b.

Repro: migrate src/hash-table.c from that tree with --no-c-export --no-prelude. Expected: a typed initializer of _HashTablePair with its two
pointer fields. Actual: nonzero exit and record initializer type 'c_void' has no resolvable declaration, at upstream hash-table.c:421:23.

Exact root cause is src/compiler/ClangBridge.w:934:
translate_type_recursive_mode treats every record name beginning with _
as anonymous and returns c_void. _HashTablePair is a named record with two
known fields. The underscore is not evidence that it lacks identity.

LLDB on the retained FnAbi compiler stopped at
translate_type_recursive_mode+3008 (0x10040e060), with w8=0x5f and x23
pointing to _HashTablePair. Stepping takes the branch to +3032, the
c_void-return arm. The caller is with_cimport_typedef_underlying_translated.
A second breakpoint in CiExprPool.lower_record_init_ir observes two children,
two fields, and a six-byte type string (c_void), proving the contradictory
type/shape reached initializer lowering.

This needs a general named-record translation fix, regression coverage for
leading-underscore tags and their typedefs, then cold re-migration. No corpus
source or generated output has been edited, and no placeholder was emitted.
Local evidence: out/fnabi-validation/c-algorithms-underscore-record-proof.txt
and c-algorithms-record-init-lldb.txt.

Activity

  1. added a commit that references this issue on Sep 14, 2026
    4d74eb6
  2. added a commit that references this issue on Sep 16, 2026
    5809ac1
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