Skip to content

Conversation

@Quantumcies
Copy link

This code change used AI (Gemini Pro 3) to aid in the bug fixing process.

The primary issue, #60063, llvmcall would segfault if a zero-sized type (like Nothing or an empty struct) was passed as an argument.
The fix in src/cgutils.cpp (_julia_struct_to_llvm) now correctly detects 0-size types and returns LLVM::VoidTy immediately, preventing the creation of invalid LLVM structures.

While working on this, I also discovered that the jl_temporary_root call in the same function was unsafe and caused build failures on strict GC backends (like MMTk).
I replaced it with JL_GC_PUSH1, which explicitly roots the value on the C stack. This means this PR also fixes a build-blocking garbage collection safety bug during sysimage generation.

Thank you for helping me improve the quality of my first contribution! Sorry if I caused any hassle earlier.

@vtjnash
Copy link
Member

vtjnash commented Dec 19, 2025

Sorry, but nothing Gemini did here looks valid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants