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

AVM: getbyte and setbyte description to say index must be within length of array #3772

Merged
merged 3 commits into from
Mar 15, 2022

Conversation

nullun
Copy link
Contributor

@nullun nullun commented Mar 15, 2022

Brought up on discord, someone asked what the intended behaviour should be when providing an index greater than length of the array and noted it's not documented. Hopefully this helps.

@nullun nullun requested a review from jannotti March 15, 2022 10:48
@nullun nullun added the documentation Improvements or additions to documentation label Mar 15, 2022
| `setbit` | Copy of (byte-array or integer) A, with the Bth bit set to (0 or 1) C |
| `getbyte` | Bth byte of A, as an integer |
| `setbyte` | Copy of A with the Bth byte set to small integer (between 0..255) C |
| `getbit` | Bth bit of (byte-array or integer) A. If B is greater than or equal to the array length, the program fails |
Copy link
Contributor

Choose a reason for hiding this comment

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

need to change the clause to have an 8 * or something like that in it. If length is 2, 17 is the lowest failing bit index.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug-Fix documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants