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
migrate: a discarded expression's failed lowering becomes an empty statement (lower_discard_expr_side_effects_ir tail); generated overflow helpers collide with C globals a/b/out #1933
CiStmtPool.lower_discard_expr_side_effects_ir (src/CImport.w) still ends:
let lowered = self.lower_value_expr_ir(session, cursor, exprs, types, scope)
if ci_value_ir_valid(lowered) and (lowered.setup_stmt as i32) != 0:
return lowered.setup_stmt
self.empty_stmt_ir()
A discarded expression ((void)e, the left of a comma) whose value lowering FAILS becomes an empty statement instead of failing the function (the statement contract is "zero means failure"). That is the silent drop class #1911 hit through the comma branch (glibc's assert ran on); fix-1911 closed the comma, __extension__, statement-expression and unary/binary-operand paths, and left this tail. I have not yet found a C expression that reaches it with a failed lowering — a repro is the first step; then return 0 there.
(Separately noticed: migrating int f(void); int a[4]; void t(void) { (void) a[f()]; } emits a global a that collides with the a parameter of every generated __with_builtin_*_overflow_* helper — "shadowing is not allowed for 'a'" — so any C file with a global named a, b or out fails to compile after migration. (void) a[f()] itself is kept as a[unsafe { f() }].)
changed the title [-]migrate: a discarded expression's failed lowering or nested side effects vanish (lower_discard_expr_side_effects_ir tail)[/-][+]migrate: a discarded expression's failed lowering becomes an empty statement (lower_discard_expr_side_effects_ir tail); generated overflow helpers collide with C globals a/b/out[/+]on Sep 30, 2026
Fixed on main by bfa0201 (#1934): the discard tail of lower_discard_expr_side_effects_ir now lowers through lower_effect_expr_ir, so a failed discarded lowering fails the statement; the overflow helpers' locals are __with_-prefixed. Verified on stage1 of main 9307016: int a[4]; (void) a[f()]; migrates and checks with no shadowing error; (void)(c ? a[g()] : 0) keeps the call inside an if/else. Fixtures behav_migrate_discarded_effects.w, behav_migrate_helper_hygiene.w.
Activity
[-]migrate: a discarded expression's failed lowering or nested side effects vanish (lower_discard_expr_side_effects_ir tail)[/-][+]migrate: a discarded expression's failed lowering becomes an empty statement (lower_discard_expr_side_effects_ir tail); generated overflow helpers collide with C globals a/b/out[/+]migrate: operators libclang does not name are translated or refused, …
c-migrator-core-tests: the u128 limb helper call names the hygienic p…
Linux: glibc's ULLONG_MAX and other mixed-sign macros translate with …
ehartford commentedon Oct 3, 2026
Fixed on main by bfa0201 (#1934): the discard tail of lower_discard_expr_side_effects_ir now lowers through lower_effect_expr_ir, so a failed discarded lowering fails the statement; the overflow helpers' locals are
__with_-prefixed. Verified on stage1 of main 9307016:int a[4]; (void) a[f()];migrates and checks with no shadowing error;(void)(c ? a[g()] : 0)keeps the call inside an if/else. Fixtures behav_migrate_discarded_effects.w, behav_migrate_helper_hygiene.w.c_import/migrate/emit-c: no `-> Unit` on void C fns (#1838); header f…
Corpora are their migrator's output again, and `:corpus-drift-check` …
Corpora are their migrator's output again, and `:corpus-drift-check` …
Corpora are their migrator's output again, and `:corpus-drift-check` …
Build store, runner, corpora, deps discovery, generic-instance identi…