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

[Bug] Array indexing allows signed integers #28523

Open
d0cd opened this issue Mar 6, 2025 · 0 comments
Open

[Bug] Array indexing allows signed integers #28523

d0cd opened this issue Mar 6, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@d0cd
Copy link
Collaborator

d0cd commented Mar 6, 2025

🐛 Bug Report

Array indexing allows for signed integers

transition foo()  {
        let data: [u8; 2] = [0u8, 1u8];
        assert_eq(data[-1i32], 0u8);
    }

This produces Aleo instructions, which is then rejected by snarkVM
The Leo compiler should correctly identify that this is an invalid access.

@d0cd d0cd added the bug Something isn't working label Mar 6, 2025
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

1 participant