Skip to content

Fix Corrupted Binary from Integer Overflow#2

Open
CoolSpy3 wants to merge 8 commits intobwiedermann:gh-pagesfrom
CoolSpy3:patch-3
Open

Fix Corrupted Binary from Integer Overflow#2
CoolSpy3 wants to merge 8 commits intobwiedermann:gh-pagesfrom
CoolSpy3:patch-3

Conversation

@CoolSpy3
Copy link

@CoolSpy3 CoolSpy3 commented Jan 4, 2024

At the moment, specifying an integer or register argument which cannot be encoded in 8 or 4 bits respectively leads to undefined behavior (likely due to string truncation and concatenations which were not designed for use with binary strings longer than 8 bits. (ex, The instruction setn r1 300 gets compiled to setn r3 44).

This PR updates the code which parses integers to truncate the higher-order bytes of numbers which cannot be encoded in 8 bits. Additionally, it adds error messages for any numbers or registers which are out of range.

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.

1 participant