Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try giving some more informative errors for various malformed input #54458

Merged
merged 1 commit into from
May 23, 2024

Conversation

Keno
Copy link
Member

@Keno Keno commented May 14, 2024

I was playing with generating some code for OpaqueClosures. It's pretty easy to generate IR that will pass the verifier, but cause assertion errors in codegen. This tries to make the experience slightly nicer by turning some of them into proper error messages (thus letting the runtime discover, so that e.g. the code can be inspected at the REPL) rather than assertions.

I was playing with generating some code for OpaqueClosures. It's
pretty easy to generate IR that will pass the verifier, but cause
assertion errors in codegen. This tries to make the experience
slightly nicer by turning some of them into proper error messages
(thus letting the runtime discover, so that e.g. the code can be
inspected at the REPL) rather than assertions.
@Keno Keno merged commit 1ed6a9f into master May 23, 2024
5 of 7 checks passed
@Keno Keno deleted the kf/malformedir branch May 23, 2024 20:46
if (source->source) {
mi = jl_specializations_get_linfo(source, sigtype, jl_emptysvec);
} else {
mi = (jl_method_instance_t *)jl_atomic_load_relaxed(&source->specializations);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do we always know that the method will have a single specialization?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opaque closures made from optimized IR source == NULL have this structure.

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.

None yet

2 participants