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/slice overflow #30

Conversation

cyberthirst
Copy link

What I did

  • fix the overflow check for slice in buildIR
  • fix the overflow check for slice in ad-hoc locations
  • add tests for oob access

How I did it

How to verify it

Commit message

Commit message for the final, squashed PR. (Optional, but reviewers will appreciate it! Please see our commit message style guide for what we would ideally like to see in a commit message.)

Description for the changelog

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

# overflow:
# valid inputs satisfy: `assert start+length <= src_len && start+length > start`
def _make_slice_bounds_check(start, length, src_len):
return [
Copy link
Owner

Choose a reason for hiding this comment

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

i'd like to see sanity check assertions that start, length and src_len all have .is_complex_ir is False

@charles-cooper charles-cooper merged commit 00435d8 into charles-cooper:fix/slice-overflow Mar 17, 2024
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants