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

Avoid assertion failure when serialising constant integer values. #136

Merged
merged 1 commit into from
Apr 22, 2024

Conversation

vext01
Copy link

@vext01 vext01 commented Apr 22, 2024

We used a loop to get the individual bytes of a constant value and serialise them.

This would crash if we ask for 8-bits from the value, but there are fewer than 8 bits to fetch. E.g. for a i1, you can never fetch a whole byte's worth of bits.

This change ensures we fetch the right number of bits (i.e. fewer than 8 if there are fewer than 8 left).

Test for this in ykjit/yk#1107

We used a loop to get the individual bytes of a constant value and
serialise them.

This would crash if we ask for 8-bits from the value, but there are
fewer than 8 bits to fetch. E.g. for a i1, you can never fetch a whole
byte's worth of bits.

This change ensures we fetch the right number of bits (i.e. fewer than 8
if there are fewer than 8 left).
@ltratt ltratt added this pull request to the merge queue Apr 22, 2024
Merged via the queue into ykjit:main with commit b1a3c62 Apr 22, 2024
2 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