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

FFI fails handling some return types #610

Open
ekgame opened this issue Nov 24, 2024 · 0 comments
Open

FFI fails handling some return types #610

ekgame opened this issue Nov 24, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@ekgame
Copy link
Contributor

ekgame commented Nov 24, 2024

I was trying to implement textures for Rayua, but I'm having trouble with the first step.

Reproduction steps:

  • Checkout feature/more-functions branch from https://github.com/ekgame/rayua/tree/feature/more-functions
  • Run uiua run examples/textures.ua
  • The console should print:
    INFO: FILEIO: [./examples/cats.png] File loaded successfully
    INFO: IMAGE: Data loaded successfully (720x720 | R8G8B8 | 1 mipmaps)
    Segmentation fault (core dumped)
    

The issue seems to be related to the return type:

# lib.ua
Texture ↚ "{unsigned int; int; int; int; int}"
LoadTexture ← Rl {Texture "LoadTexture" "const char*"} {∘}

Changing the Texture type signature to "{unsigned int; int; int; int}" (missing last int) fails to open file and returns an array with nonsense data, but does not segmentation fault.

@kaikalii kaikalii self-assigned this Nov 24, 2024
@kaikalii kaikalii added the bug Something isn't working label Nov 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants