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
Migrator erases named record types with leading underscores to c_void #1124
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
stdlib sourcing Phase 1: the c-algorithms corpus, its upstream tests,…
C algorithms phase1 (withlang-dev#1142)