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

fix C codegen regression with closures #1392

Merged

Commits on Jul 30, 2024

  1. fix C codegen regression with closures

    Summary
    -------
    
    Fix explicit or implicit creation of a closure leading to the C
    compiler errors when using strict(er) C compilers.
    
    Details
    -------
    
    * when lowering the closure types, use a `tkProc` type with `ccClosure`
      calling convention
    * using a `ccNimCall` type with an additional `void` parameter meant
      that `cgen` placed the result type (in case of RVO) *after* the
      environment type, which is incorrect and doesn't match the signature
      of closure procedures
    * C compilers that require proper typing for pointer assignments
      rightfully reported an error in this case
    zerbina committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    2699e95 View commit details
    Browse the repository at this point in the history