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

Improve error handling while parsing #41

Open
rilysh opened this issue Apr 28, 2023 · 0 comments
Open

Improve error handling while parsing #41

rilysh opened this issue Apr 28, 2023 · 0 comments

Comments

@rilysh
Copy link

rilysh commented Apr 28, 2023

Thanks for your work! There are a couple of things I see that can be improved, especially error handling. Tinyvm doesn't seem to check whether given instructions are correct or not, and it simply parses any kind of file (even an empty one) which results in a segfault. Maybe check if there's any matching token that exists or not and then parse? Besides, tinyvm also doesn't handle errors if an instruction register is missing or incomplete, e.g. instead of add eax, 1 if we just give add vm will get a segfault. Also, instructions like ret result in segfault (not sure what causes it).

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

No branches or pull requests

1 participant