julia
114a0156 - codegen: fix bitcast of union values with inline_roots (#61027)

Commit
64 days ago
codegen: fix bitcast of union values with inline_roots (#61027) ## Summary - When a union type contains members with mixed GC-pointer and non-pointer fields, codegen uses "split representation" (`inline_roots`). `generic_bitcast` called `ispointer()`/`data_pointer()` which assert `inline_roots.empty()`, causing an assertion failure. - Handle the `inline_roots` case by loading directly from `v.V` before falling through to `ispointer()`. The dynamic runtime checks (isprimitivetype + size match) already guarantee only primitive types reach the load. - Discovered via LinearSolve's KLU extension, which bitcasts a union value containing structs with Vector fields. ## Test plan - Added test in `test/intrinsics.jl` that exercises `Core.Intrinsics.bitcast` on a union containing a struct with GC-pointer fields (split representation). This PR was written with the assistance of generative AI (Claude). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Author
Parents
Loading