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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] indexing nested value from slice during mutation causes failed to select #1079

Closed
0rphon opened this issue Jun 29, 2021 · 0 comments 路 Fixed by #1093
Closed

[Bug] indexing nested value from slice during mutation causes failed to select #1079

0rphon opened this issue Jun 29, 2021 · 0 comments 路 Fixed by #1093
Assignees
Labels
bug Something isn't working priority-high A high priority bug/task in Leo.

Comments

@0rphon
Copy link
Contributor

0rphon commented Jun 29, 2021

馃悰 Bug Report

Code snippet to reproduce

function main () {
    let x = [0u8; (3, 4)];
    x[0..][0] = [1; 4];     // works
    x[0..][0][0] = 2;       // fails
}

Stack trace & error message

D:\Work\leo-playground>D:\Work\leo_repos\leo\target\release\leo clean && D:\Work\leo_repos\leo\target\release\leo run
      Done Finished in 0 milliseconds 

     Build Starting...
     Build Compiling main program... ("D:\\Work\\leo-playground\\src/main.leo")
      Done Finished in 2 milliseconds

Error:     --> D:\Work\leo-playground\src/main.leo:4:5
     |
   4 |     x[0..][0][0] = 2;       // fails
     |     ^^^^^^^^^^^^^^^^
     |
     = Conditional select gadget failed to select between `2` or `[1, 1, 1, 1]`

Your Environment

  • leo commit 2e0dab1
  • rustc version 1.55.0-nightly
  • Windows 10.0.19043 (Windows 10 Pro) [64-bit]
@0rphon 0rphon added bug Something isn't working fuzz-bug labels Jun 29, 2021
@gluax gluax self-assigned this Jun 30, 2021
@gluax gluax added the priority-high A high priority bug/task in Leo. label Jul 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority-high A high priority bug/task in Leo.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants