Skip to content

[JuliaLowering] ccall((lib,sym)...) and cfunction fixes#60257

Merged
topolarity merged 1 commit into
JuliaLang:masterfrom
mlechu:jl-cstuff
Dec 1, 2025
Merged

[JuliaLowering] ccall((lib,sym)...) and cfunction fixes#60257
topolarity merged 1 commit into
JuliaLang:masterfrom
mlechu:jl-cstuff

Conversation

@mlechu

@mlechu mlechu commented Nov 26, 2025

Copy link
Copy Markdown
Member
  • ccall with a lib,sym tuple argument was being desugared to a call to Core.Tuple when we actually want an Expr(:tuple)

  • cfunction only worked in simple cases, since the check for local variables in scope resolution will fail with any nontrivial function body. I know that using the new static_eval head could be considered a bugfix (see discussion at Add K"static_eval" for cfunction/ccall/cglobal JuliaLowering.jl#36), but this PR just uses inert to match Base.

stdlib status: 38/51 (with #60255)

- `ccall` with a `lib,sym` tuple argument was being desugared to a call to
    `Core.Tuple` when we actually want an `Expr(:tuple)`

- `cfunction` only worked in simple cases, since the check for local variables
     in scope resolution will fail with any nontrivial function body.  I know
     that using the new `static_eval` head could be considered a bugfix (see
     discussion at JuliaLang/JuliaLowering.jl#36), but
     this PR just uses `inert` to match Base.

stdlib status: 38/51
@mlechu
mlechu requested review from c42f and topolarity November 26, 2025 20:35
@mlechu mlechu added the compiler:lowering Syntax lowering (compiler front end, 2nd stage) label Nov 26, 2025

@topolarity topolarity left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks much, @mlechu !

@topolarity
topolarity merged commit 7a64241 into JuliaLang:master Dec 1, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compiler:lowering Syntax lowering (compiler front end, 2nd stage)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants