8000 encoder: Fix int ranges for which BININT1 and BININT2 are emitted by navytux · Pull Request #71 · kisielk/og-rek · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

encoder: Fix int ranges for which BININT1 and BININT2 are emitted #71

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

Merged
merged 1 commit into from
Aug 16, 2024

Conversation

navytux
Copy link
Collaborator
@navytux navytux commented Jul 29, 2024

BININT1 emits unsigned integer that fits into 1 byte. BININT2 emits unsigned integer that fits into 2 bytes.

So they cover [0, 0xff] and [0, 0xffff] ranges including edges. However we were emitting BININTX opcodes only for numbers being strictly inside those ranges - i.e. (0, 0xff) and (0, 0xffff) - without edges. As the result what could be emitted as "K\x00." was emitted as "J\x00\x00\x00\x00." and so on.

Fix it by emitting BININT1 for [0, 0xff] inclusive and BININT for [0, 0xffff] also inclusive.

BININT1 emits unsigned integer that fits into 1 byte.
BININT2 emits unsigned integer that fits into 2 bytes.

So they cover [0, 0xff] and [0, 0xffff] ranges including edges. However
we were emitting BININTX opcodes only for numbers being strictly inside
those ranges - i.e. (0, 0xff) and (0, 0xffff) - without edges. As the
result what could be emitted as "K\x00." was emitted as
"J\x00\x00\x00\x00." and so on.

Fix it by emitting BININT1 for [0, 0xff] inclusive and BININT for [0,
0xffff] also inclusive.
@kisielk kisielk merged commit 6ce3a6e into kisielk:master Aug 16, 2024
13 checks passed
@navytux navytux deleted the y/binint-fix branch August 17, 2024 18:02
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
0