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
codegen: a module global demoted to runtime init inside a bundle fails silently (zeroed data or a late ICE) #2219
Found on #2218 (D102). gen_module_constant folds a global's initializer with try_eval_const_llvm; a field it cannot fold demotes the WHOLE global to runtime init (queue_module_runtime_init). In a .wo bundle / standalone runtime object that init never runs (the comment at CodegenTraits.w try_eval_const_llvm, #880, records the class: pcre2's default match context lost heap_limit), and a body in another unit that takes the global's address hits BUG: reference rvalue N: place M has no address (mir_bind_global_locals binds only globals in module_constants).
Two silent tools:
with check … --validate-all says ok — the MIR is valid, so the validator is not the right place; but nothing between folding and codegen says "this global is runtime-initialized in an object whose init will not run".
the demotion itself is silent: it should be a loud refusal in bundle/standalone-object mode (name the global and the field that did not fold), never zeroed storage.
The D102 instance (Option[extern "C" fn] fields holding Some(fn)) is folded on #2218 (try_eval_const_option_pointer_llvm); this issue is the guard that would have caught it at the global instead of in a downstream body.
Activity
D102: nullable C function pointers are Option, placed by direction; e…
D102: non-null extern fn; nullable C function pointers as pointer-siz…
codegen: a bundle global whose initializer did not fold is refused wh…
migrate: C's {0} on a record and memset-to-zero of a record are T.zer…
Migrator: a handle forwarded untested to a NULL-accepting parameter a…
Migrator: C truth tests on integers migrate as written (D177); re-pro…